From 77ab7d1462ed17b62a4e830a0323a0d4e090aa2f Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 14 May 2020 14:11:00 +0000 Subject: [PATCH] tasks: add a rollback task --- lib/tasks/deploy.rake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/tasks/deploy.rake b/lib/tasks/deploy.rake index 371776366..a311c43a2 100644 --- a/lib/tasks/deploy.rake +++ b/lib/tasks/deploy.rake @@ -32,3 +32,13 @@ task :post_deploy do sh "mina post_deploy domain=#{domains.first} branch=#{branch}" end + +task :rollback do + domains = domains_for_stage(ENV.fetch('STAGE')) + branch = ENV.fetch('BRANCH') + + domains.each do |domain| + sh "mina rollback domain=#{domain} branch=#{branch}" + sh "mina service:restart_puma domain=#{domain} branch=#{branch}" + end +end