diff options
author | Rob Loach <robloach@gmail.com> | 2015-02-07 22:05:07 -0500 |
---|---|---|
committer | Rob Loach <robloach@gmail.com> | 2015-02-07 22:05:07 -0500 |
commit | bc0f13b93a3b20f1640c75c9f28fe77b5a4c89ca (patch) | |
tree | 3530b776e0b69f6d7449a46224f46487ca576578 /src/GitDeploy/Console/Command | |
parent | 7ca89a5eb6c7993658c9efce339f6805a0ee8351 (diff) | |
download | git-deploy-bc0f13b93a3b20f1640c75c9f28fe77b5a4c89ca.zip git-deploy-bc0f13b93a3b20f1640c75c9f28fe77b5a4c89ca.tar.gz git-deploy-bc0f13b93a3b20f1640c75c9f28fe77b5a4c89ca.tar.bz2 |
Rename to Git Deploy0.0.4
Diffstat (limited to 'src/GitDeploy/Console/Command')
-rw-r--r-- | src/GitDeploy/Console/Command/DeployCommand.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/GitDeploy/Console/Command/DeployCommand.php b/src/GitDeploy/Console/Command/DeployCommand.php new file mode 100644 index 0000000..b504d4b --- /dev/null +++ b/src/GitDeploy/Console/Command/DeployCommand.php @@ -0,0 +1,40 @@ +<?php + +namespace GitDeploy\Console\Command; + +use GitDeploy\GitDeploy; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class DeployCommand extends Command +{ + protected function configure() + { + $this + ->setName('deploy') + ->setDescription('Deploys the list of repositories.') + ->addOption( + 'file', + 'f', + InputOption::VALUE_OPTIONAL, + 'The configuration file to load.', + 'git-deploy.json' + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $deploy = GitDeploy::fromFile($input->getOption('file')); + $repositories = $deploy->getRepositories(); + if (empty($repositories)) { + $output->writeln('<info>Configuration file empty.</info>'); + } + else { + $deploy->update(); + } + } +} |