Capistrano::ConsulKvLock
Introduces deployment lock using consul KVS
Detail
Using this plugin, capistrano just puts consul KVS a lock value, then the deployment is prohibitted in another host for the lock value is released.
Installation
Add this line to your application's Gemfile:
gem 'capistrano-consul_kv_lock'
And then execute:
$ bundle
Or install it yourself as:
$ gem install capistrano-consul_kv_lock
Activate in Capfile
:
require 'capistrano/consul_kv_lock'
Usage
Settings
# Consul API URL that the operator uses as KVS.
set :consul_url, -> { 'http://localhost:8500' }
# A key name for locking deploy.
set :consul_lock_key, -> { 'deployment/locked' }
Force unlock
Delete the KVS lock value.
$ curl -X DELETE ${your_consul_host}:8500/v1/kv/deployment/locked
Contributing
- Fork it ( https://github.com/udzura/capistrano-consul_kv_lock/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