Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #13 from niels-nijens/create-release-to-install-re…
Browse files Browse the repository at this point in the history
…lease

Renamed 'create release' to 'install release'
  • Loading branch information
niels-nijens committed Sep 30, 2015
2 parents e5a899d + 21d4510 commit 20cb594
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions src/Accompli.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ public function initializeEventListeners()
}

/**
* Dispatches release creation events.
* Dispatches release installation events.
*
* @param Host $host
*
* @todo Add DeploymentAdapter (connection)
**/
public function createRelease(Host $host)
public function installRelease(Host $host)
{
$prepareWorkspaceEvent = new PrepareWorkspaceEvent($host);
$this->dispatch(AccompliEvents::PREPARE_WORKSPACE, $prepareWorkspaceEvent);
Expand All @@ -127,6 +127,6 @@ public function createRelease(Host $host)
}
}

$this->dispatch(AccompliEvents::CREATE_RELEASE_FAILED, new FailedEvent());
$this->dispatch(AccompliEvents::INSTALL_RELEASE_FAILED, new FailedEvent());
}
}
22 changes: 11 additions & 11 deletions src/AccompliEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@
**/
final class AccompliEvents
{
/**
* The CREATE_RELEASE_FAILED event is dispatched when creation of a Release has failed.
*
* The event listener receives an
* Accompli\Event\FailedEvent instance.
*
* @var string
**/
const CREATE_RELEASE_FAILED = 'accompli.create_release_failed';

/**
* The DEPLOY_RELEASE event is dispatched when a Release is ready for deployment.
*
Expand Down Expand Up @@ -69,6 +59,16 @@ final class AccompliEvents
**/
const INSTALL_RELEASE = 'accompli.install_release';

/**
* The INSTALL_RELEASE_FAILED event is dispatched when installation of a Release has failed.
*
* The event listener receives an
* Accompli\Event\FailedEvent instance.
*
* @var string
**/
const INSTALL_RELEASE_FAILED = 'accompli.create_release_failed';

/**
* The PREPARE_DEPLOY_RELEASE event is dispatched when a Release is prepared for deployment.
*
Expand Down Expand Up @@ -137,12 +137,12 @@ final class AccompliEvents
public static function getEventNames()
{
return array(
self::CREATE_RELEASE_FAILED,
self::DEPLOY_RELEASE,
self::DEPLOY_RELEASE_COMPLETE,
self::DEPLOY_RELEASE_FAILED,
self::GATHER_FACTS,
self::INSTALL_RELEASE,
self::INSTALL_RELEASE_FAILED,
self::PREPARE_DEPLOY_RELEASE,
self::PREPARE_RELEASE,
self::PREPARE_WORKSPACE,
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Accompli\Console;

use Accompli\Accompli;
use Accompli\Console\Command\CreateReleaseCommand;
use Accompli\Console\Command\DeployReleaseCommand;
use Accompli\Console\Command\InstallReleaseCommand;
use Accompli\Console\Command\StatusCommand;
use Symfony\Component\Console\Application as BaseApplication;

Expand Down Expand Up @@ -42,7 +42,7 @@ protected function getDefaultCommands()
{
$commands = parent::getDefaultCommands();
$commands[] = new StatusCommand();
$commands[] = new CreateReleaseCommand();
$commands[] = new InstallReleaseCommand();
$commands[] = new DeployReleaseCommand();

return $commands;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
use Symfony\Component\Console\Output\OutputInterface;

/**
* CreateReleaseCommand.
* InstallReleaseCommand.
*
* @author Niels Nijens <nijens.niels@gmail.com>
*/
class CreateReleaseCommand extends Command
class InstallReleaseCommand extends Command
{
/**
* Configures this command.
*/
protected function configure()
{
$this
->setName('create-release')
->setDescription('Creates a new release for deployment.')
->addArgument('version', InputArgument::REQUIRED, 'The version to create a release for.')
->setName('install-release')
->setDescription('Installs a new release for deployment.')
->addArgument('version', InputArgument::REQUIRED, 'The version to install a release for.')
->addArgument('stage', InputArgument::OPTIONAL, 'The stage to select hosts for.')
->addOption('project-dir', null, InputOption::VALUE_OPTIONAL, 'The location of the project directory.', getcwd());
}
Expand All @@ -50,7 +50,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

foreach ($hosts as $host) {
$accompli->createRelease($host);
$accompli->installRelease($host);
}
}
}

0 comments on commit 20cb594

Please sign in to comment.