Skip to content

Commit

Permalink
Keep 2 backups so we have an extra one when there is a sync, then a
Browse files Browse the repository at this point in the history
deploy.
  • Loading branch information
Jelle-S committed May 6, 2019
1 parent f51099e commit 045ad23
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/AbstractRoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -1084,10 +1084,13 @@ protected function cleanDirsTask($worker, AbstractAuth $auth, $remote)
$task = $this->taskSsh($worker, $auth)
->remoteDirectory($remote['rootdir'], true)
->timeout($this->getTimeoutSetting('clean_dir'))
->exec('vendor/bin/robo digipolis:clean-dir ' . $remote['releasesdir'] . ($cleandirLimit ? ':' . $cleandirLimit : ''));
// Keep one more release than the clean_dir setting, we would like
// to keep `clean_dir` amount of releases, *not* counting the
// current one.
->exec('vendor/bin/robo digipolis:clean-dir ' . $remote['releasesdir'] . ($cleandirLimit ? ':' . ($cleandirLimit + 1) : ''));

if ($remote['createbackup']) {
$task->exec('vendor/bin/robo digipolis:clean-dir ' . $remote['backupsdir'] . ($cleandirLimit ? ':' . --$cleandirLimit : ''));
$task->exec('vendor/bin/robo digipolis:clean-dir ' . $remote['backupsdir'] . ($cleandirLimit ? ':' . $cleandirLimit : ''));
}

return $task;
Expand Down

0 comments on commit 045ad23

Please sign in to comment.