Skip to content

Commit 944d692

Browse files
authored
Merge pull request #47 from ub-digit/safer-production-deploy
Increase foolproofness of production deploy
2 parents ca23245 + 89a4cf2 commit 944d692

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

config/deploy.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,15 @@ def deploy_config
2626
}
2727

2828
set :branch, 'master'
29+
30+
namespace :deploy do
31+
before "git:check", :alert_deploying_to_stage do
32+
on roles(:all) do |host|
33+
colors = SSHKit::Color.new($stdout)
34+
message = "You are about to deploy to #{fetch(:stage)}"
35+
if fetch(:stage) == :production
36+
info colors.colorize("\e[5m#{message}!\e[0m", :red)
37+
end
38+
end
39+
end
40+
end

config/deploy/production.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
set :branch, ''

0 commit comments

Comments
 (0)