mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
added rollback
This commit is contained in:
parent
35af8c0ba2
commit
30b1ae901b
2 changed files with 19 additions and 4 deletions
|
@ -298,3 +298,7 @@ Deploy new code:
|
|||
mina deploy # staging
|
||||
mina pr deploy # production
|
||||
|
||||
Rollback to previous release:
|
||||
|
||||
mina rollback # staging
|
||||
mina pr rollback # production
|
||||
|
|
|
@ -86,13 +86,24 @@ task deploy: :environment do
|
|||
invoke :'rails:db_migrate'
|
||||
invoke :'rails:assets_precompile'
|
||||
invoke :'whenever:update'
|
||||
|
||||
to :launch do
|
||||
queue "mkdir -p #{deploy_to}/current/tmp; touch #{deploy_to}/current/tmp/restart.txt"
|
||||
end
|
||||
invoke :restart
|
||||
end
|
||||
end
|
||||
|
||||
desc 'Rolls back the latest release'
|
||||
task rollback: :environment do
|
||||
queue! %[echo "-----> Rolling back to previous release for instance: #{domain}"]
|
||||
queue %[ls "#{deploy_to}/releases" -Art | sort | tail -n 2 | head -n 1]
|
||||
queue! %[ls -Art "#{deploy_to}/releases" | sort | tail -n 2 | head -n 1 | xargs -I active ln -nfs "#{deploy_to}/releases/active" "#{deploy_to}/current"]
|
||||
invoke :'whenever:update'
|
||||
invoke :restart
|
||||
end
|
||||
|
||||
desc 'Restart Passenger application'
|
||||
task restart: :environment do
|
||||
queue "mkdir -p #{deploy_to}/current/tmp; touch #{deploy_to}/current/tmp/restart.txt"
|
||||
end
|
||||
|
||||
# For help in making your deploy script, see the Mina documentation:
|
||||
#
|
||||
# - http://nadarei.co/mina
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue