diff --git a/src/RoboFileBase.php b/src/RoboFileBase.php index 771c3aa..77e95e6 100644 --- a/src/RoboFileBase.php +++ b/src/RoboFileBase.php @@ -28,7 +28,7 @@ public function __construct() protected function isSiteInstalled($worker, AbstractAuth $auth, $remote) { - $currentProjectRoot = $remote['currentdir'] . '/..'; + $currentProjectRoot = $this->getCurrentProjectRoot($worker, $auth, $remote); $migrateStatus = ''; $status = $this->taskSsh($worker, $auth) ->remoteDirectory($currentProjectRoot, true) @@ -98,7 +98,7 @@ protected function preRestoreBackupTask( $opts['files'] = true; $opts['data'] = true; } - $currentProjectRoot = $remote['currentdir'] . '/..'; + $currentProjectRoot = $remote['rootdir']; $collection = $this->collectionBuilder(); $parent = parent::preRestoreBackupTask($worker, $auth, $remote); if ($parent) { @@ -117,7 +117,7 @@ protected function preRestoreBackupTask( protected function installTask($worker, AbstractAuth $auth, $remote, $extra = [], $force = false) { - $currentProjectRoot = $remote['currentdir'] . '/..'; + $currentProjectRoot = $remote['rootdir'];; $collection = $this->collectionBuilder(); $collection->taskSsh($worker, $auth) ->remoteDirectory($currentProjectRoot, true) @@ -132,7 +132,7 @@ protected function installTask($worker, AbstractAuth $auth, $remote, $extra = [] protected function updateTask($server, AbstractAuth $auth, $remote, $extra = []) { - $currentProjectRoot = $remote['currentdir'] . '/..'; + $currentProjectRoot = $remote['rootdir']; return $this->taskSsh($server, $auth) ->remoteDirectory($currentProjectRoot, true) // Updates can take a long time. Let's set it to 15 minutes. @@ -142,7 +142,7 @@ protected function updateTask($server, AbstractAuth $auth, $remote, $extra = []) protected function clearCacheTask($worker, $auth, $remote) { - $currentProjectRoot = $remote['currentdir'] . '/..'; + $currentProjectRoot = $remote['rootdir']; return $this->taskSsh($worker, $auth) ->remoteDirectory($currentProjectRoot, true) ->timeout(120) diff --git a/src/default.properties.yml b/src/default.properties.yml index e1ec56c..1f6fcf8 100644 --- a/src/default.properties.yml +++ b/src/default.properties.yml @@ -1,7 +1,8 @@ remote: appdir: '/home/[user]/apps/[app]' releasesdir: '${remote.appdir}/releases' - webdir: '${remote.releasesdir}/[time]/web' + rootdir: '${remote.releasesdir}/[time]' + webdir: '${remote.rootdir}/web' currentdir: '${remote.appdir}/current' configdir: '${remote.appdir}/config' filesdir: '${remote.appdir}/files'