public function testBash() { $scripts = ['travis_ci_script_1' => function ($input, $output) { # I must be able to call a CLI or any classes here CLI::process('echo "Testing CLI::handleCallback()"'); $output->writeln("<comment>testing writeln with comment style</comment>"); $output->writeln("<error>testing writeln with error style</error>"); # also when returning an array or string # it should be able to handle this scripts return ['echo "Script 1: returning array in callback"']; }, 'travis_ci_script_2' => 'echo "Script 2: using CLI::process(<string>)"', 'travis_ci_script_3' => ['echo "Script 3: using CLI::bash(<array>)"'], 'travis_ci_script_4' => CLI::ssh('*****@*****.**', ['ls'], $execute = false), 'travis_ci_script_5' => function ($input, $output) { return 'echo "Script 5: returning string in callback"'; }]; # a callback, returning array CLI::handleCallback($scripts['travis_ci_script_1']); # a string CLI::process($scripts['travis_ci_script_2']); # an array CLI::bash($scripts['travis_ci_script_3']); # a generated ssh script // CLI::process($scripts['travis_ci_script_4']); # a callback, returning string CLI::handleCallback($scripts['travis_ci_script_5']); # this must automatically be executed, the third # parameter is automatically assigned as true // CLI::ssh('*****@*****.**', ['ls']); }
<?php use Clarity\Console\CLI; return ['pull' => ['cd ' . config('path.root'), 'git pull origin master', 'php brood clear:cache', 'php brood clear:logs', 'php brood clear:session', 'php brood clear:views', 'php brood db:migrate', 'composer update', 'composer dumpautoload'], 'deploy' => [CLI::ssh('*****@*****.**', function () { return ['cd /var/www', 'ls']; }, $execute = false)]]; # end of return