[Nostromo] Add tests

This commit is contained in:
Andrés Montañez
2017-01-01 01:28:58 -03:00
parent 74c60f55ef
commit 196f84ceb1
16 changed files with 1957 additions and 17 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ class DeployCommand extends AbstractCommand
$this->log(sprintf('Environment: %s', $this->runtime->getEnvironment()));
if ($this->runtime->getEnvironmentConfig('releases', false)) {
$this->runtime->setReleaseId(date('YmdHis'));
$this->runtime->generateReleaseId();
$output->writeln(sprintf(' Release ID: <fg=green>%s</>', $this->runtime->getReleaseId()));
$this->log(sprintf('Release ID: %s', $this->runtime->getReleaseId()));
}
@@ -87,7 +87,7 @@ class ListCommand extends AbstractCommand
$cmdListReleases = sprintf('ls -1 %s/releases', $hostPath);
/** @var Process $process */
$process = $this->runtime->runRemoteCommand($cmdListReleases, true);
$process = $this->runtime->runRemoteCommand($cmdListReleases, false);
if (!$process->isSuccessful()) {
throw new RuntimeException(sprintf('Unable to retrieve releases from host %s', $host), 800);
}
@@ -102,7 +102,7 @@ class ListCommand extends AbstractCommand
$cmdCurrentRelease = sprintf('readlink -f %s/current', $hostPath);
/** @var Process $process */
$process = $this->runtime->runRemoteCommand($cmdCurrentRelease, true);
$process = $this->runtime->runRemoteCommand($cmdCurrentRelease, false);
if (!$process->isSuccessful()) {
throw new RuntimeException(sprintf('Unable to retrieve current release from host %s', $host), 850);
}
@@ -118,7 +118,7 @@ class RollbackCommand extends DeployCommand
$cmdListReleases = sprintf('ls -1 %s/releases', $hostPath);
/** @var Process $process */
$process = $this->runtime->runRemoteCommand($cmdListReleases, true);
$process = $this->runtime->runRemoteCommand($cmdListReleases, false);
if (!$process->isSuccessful()) {
$releases = [];
} else {