35 lines
889 B
PHP
Raw Normal View History

<?php
/* (c) Anton Medvedev <anton@medv.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Deployer;
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();