/** * Setup configuration option. * * @param string $name * @param mixed $value */ function set($name, $value) { if (Context::get() === false) { Deployer::setDefault($name, $value); } else { Context::get()->getEnvironment()->set($name, $value); } }
return 'ln -nfs --relative'; } } return 'ln -nfs'; }); /** * Default arguments and options. */ argument('stage', InputArgument::OPTIONAL, 'Run tasks only on this server or group of servers'); option('tag', null, InputOption::VALUE_OPTIONAL, 'Tag to deploy'); option('revision', null, InputOption::VALUE_OPTIONAL, 'Revision to deploy'); option('branch', null, InputOption::VALUE_OPTIONAL, 'Branch to deploy'); /** * Tasks */ desc('Show current release'); task('current', function () { writeln('Current release: ' . basename(get('current_path'))); }); /** * Success message */ task('success', function () { Deployer::setDefault('terminate_message', '<info>Successfully deployed!</info>'); })->once()->setPrivate(); /** * Deploy failure */ task('deploy:failed', function () { })->setPrivate(); onFailure('deploy', 'deploy:failed');