Skip to content

Commit

Permalink
Merge pull request #45 from dariocravero/patch-2
Browse files Browse the repository at this point in the history
Cleanup fails to cd releases_path
  • Loading branch information
rstacruz committed Aug 14, 2012
2 parents 54862bd + 7cb8b87 commit 3c6e718
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/mina/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
All other deployed revisions are removed from the servers."
task :cleanup do
queue %{echo "-----> Cleaning up old releases (keeping #{keep_releases!})"}
queue echo_cmd %{cd "#{deploy_to!}" || exit 15}
queue echo_cmd %{cd "#{releases_path!}" || exit 16}
queue echo_cmd %{cd "#{deploy_to!}/#{releases_path!}" || exit 15}
queue echo_cmd %{count=`ls -1d [0-9]* | sort -rn | wc -l`}
queue echo_cmd %{remove=$((count > 5 ? count - #{keep_releases} : 0))}
queue echo_cmd %{ls -1d [0-9]* | sort -rn | tail -n $remove | xargs rm -rf {}}
Expand Down

0 comments on commit 3c6e718

Please sign in to comment.