mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-09-08 22:38:56 +02:00
[Nostromo] Add tests
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user