Skip to content

Commit

Permalink
do not continue deploy on username match
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorntrondsen committed May 20, 2024
1 parent 65adad5 commit a69e282
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions lib/capistrano/tasks/deploy-lock.rake
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,7 @@ namespace :deploy do
# Unexpired lock is present, so display the lock message
puts message(fetch(:application), fetch(:stage), deploy_lock)

# Don't raise exception if current user owns the lock, and lock has an expiry time.
# Just sleep for a few seconds so they have a chance to cancel the deploy with Ctrl-C
if deploy_lock[:expire_at] && deploy_lock[:username] == ENV['USER']
10.downto(1) do |i|
Kernel.print "\r\e[0;33mDeploy lock was created by you (#{ENV['USER']}). Continuing deploy in #{i}...\e[0m"
sleep 1
end
puts
else
exit 1
end
exit 1
end

namespace :unlock do
Expand Down

0 comments on commit a69e282

Please sign in to comment.