Capistrano::Deploylock
lock set to deployed server for 1 day.
Installation
Add this line to your application's Gemfile:
gem 'capistrano-deploylock'
And then execute:
$ bundle
Or install it yourself as:
$ gem install capistrano-deploylock
Usage
add config/deploy.rb
require 'capistrano/deploylock'
before "deploy:lock:start", "deploy:lock:check"
before "deploy", "deploy:lock:start"
Why
- to ask people 'Can I deploy this server?', is almost Time-consuming.
- not ask peoble, but sever.
- no lockfile sets, you can always deploy. deployment runs quickly.
Feauture
- after you run
cap deploy
command, lockfile has set to deployed server, then anyone cannot deploy 24h except you. - but
cap deploy:lock:end
command abort lock. - when deploy, if lockfile exits,
- it is maked by yourself,
expired_at
has update to 24h after by now. - it is not maked by yourself,
expired_at
not over current time, you can deploy. - it is not maked by yourself,
expired_at
over current time, you can deploy.
cmd
- lock start
% bundle exec cap $STAGE deploy:lock:start
- lock end
% bundle exec cap $STAGE deploy:lock:end
- lock check
% bundle exec cap $STAGE deploy:lock:check
Contributing
- Fork it ( https://github.com/[my-github-username]/capistrano-deploylock/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request