deployer/recipe/config/current.php

30 lines
712 B
PHP
Raw Normal View History

2017-03-22 23:53:23 +07:00
<?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;
2017-03-23 11:34:52 +07:00
use Deployer\Host\Host;
2017-03-22 23:53:23 +07:00
use Symfony\Component\Console\Helper\Table;
desc('Show current paths');
task('config:current', function () {
$rows = [];
2017-03-23 11:34:52 +07:00
on(input()->getArgument('stage'), function (Host $host) use (&$rows) {
$rows[] = [
$host->getHostname(),
2017-03-24 21:07:40 +07:00
basename($host->getConfig()->get('current_path')),
2017-03-23 11:34:52 +07:00
];
});
2017-03-22 23:53:23 +07:00
$table = new Table(output());
$table
->setHeaders(['Host', 'Current',])
->setRows($rows);
$table->render();
})->local();