25 lines
750 B
PHP
Raw Normal View History

<?php
namespace Deployer;
2021-10-11 22:07:45 +02:00
desc('Display info about deployment');
task('deploy:info', function () {
$what = '';
$branch = get('branch');
if (!empty($branch)) {
2020-04-25 23:00:08 +03:00
$what = "<fg=magenta;options=bold>$branch</>";
}
if (input()->hasOption('tag') && !empty(input()->getOption('tag'))) {
$tag = input()->getOption('tag');
2020-04-25 23:00:08 +03:00
$what = "tag <fg=magenta;options=bold>$tag</>";
}
if (input()->hasOption('revision') && !empty(input()->getOption('revision'))) {
$revision = input()->getOption('revision');
2020-04-25 23:00:08 +03:00
$what = "revision <fg=magenta;options=bold>$revision</>";
}
if (empty($what)) {
2020-04-25 23:00:08 +03:00
$what = "<fg=magenta;options=bold>HEAD</>";
}
2020-07-26 22:35:08 +03:00
info("deploying $what");
})
2020-04-25 23:00:08 +03:00
->shallow();