From 3f22cc6288fab1d6886d5640d418ec42743d68d5 Mon Sep 17 00:00:00 2001 From: Ante Galic Date: Tue, 12 Jun 2018 15:20:37 +0200 Subject: [PATCH] Add optional symlink --- src/Task/BuiltIn/Deploy/ReleaseTask.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Task/BuiltIn/Deploy/ReleaseTask.php b/src/Task/BuiltIn/Deploy/ReleaseTask.php index ab767f0..231dd2a 100644 --- a/src/Task/BuiltIn/Deploy/ReleaseTask.php +++ b/src/Task/BuiltIn/Deploy/ReleaseTask.php @@ -40,8 +40,10 @@ class ReleaseTask extends AbstractTask implements ExecuteOnRollbackInterface $hostPath = rtrim($this->runtime->getEnvOption('host_path'), '/'); $releaseId = $this->runtime->getReleaseId(); + + $symlink = $this->runtime->getEnvOption('symlink', 'current'); - $cmdLinkRelease = sprintf('cd %s && ln -snf releases/%s current', $hostPath, $releaseId); + $cmdLinkRelease = sprintf('cd %s && ln -snf releases/%s %s', $hostPath, $releaseId, $symlink); /** @var Process $process */ $process = $this->runtime->runRemoteCommand($cmdLinkRelease, false, null);