Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dena/capistrano-deploy_locker
Capistrano Plugin to Lock Deployment
https://github.com/dena/capistrano-deploy_locker
capistrano deployment
Last synced: 29 days ago
JSON representation
Capistrano Plugin to Lock Deployment
- Host: GitHub
- URL: https://github.com/dena/capistrano-deploy_locker
- Owner: DeNA
- License: mit
- Created: 2017-04-12T04:19:52.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-08-03T08:41:40.000Z (over 3 years ago)
- Last Synced: 2024-12-18T07:56:27.568Z (about 2 months ago)
- Topics: capistrano, deployment
- Language: Ruby
- Size: 10.7 KB
- Stars: 3
- Watchers: 15
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[![Gem Version](https://badge.fury.io/rb/capistrano-deploy_locker.svg)](https://badge.fury.io/rb/capistrano-deploy_locker)
[![Build Status](https://travis-ci.org/DeNADev/capistrano-deploy_locker.svg?branch=master)](https://travis-ci.org/DeNADev/capistrano-deploy_locker)
# Capistrano::DeployLockerA capistrano plugin to make deployment with exclusive lock.
In other words, this protects any two processes from running `cap deploy`
command at the same time.## Installation
Add this line to your application's Gemfile:
```ruby
gem 'capistrano-deploy_locker'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install capistrano-deploy_locker
## Configuration
Set Capistrano variables with `set name, value`.
Name | Default | Description
-----|---------|------------
deploy_lock_key | `"#{fetch(:application)}.#{fetch(:stage)}"` | String to specify lock target
deploy_lock_dir | `./.lock` | Directory to write lockfile or other info
deploy_lock_user | `ENV['USER'] \|\| ENV['LOGIN']` | Who locks deploy
deploy_lock_reason | `"#{$0} #{ARGV}"` | Why deploy is lockedYou can provide `:deploy_lock_user` and `:deploy_lock_reason` to show infomation
of your deployment for other operators who try to get lock in fail.## Usage
Edit Capfile:
```ruby
# Load DSL and Setup Up Stages
require 'capistrano/setup'# Includes default deployment tasks
require 'capistrano/deploy'# Includes tasks from other gems included in your Gemfile
require 'capistrano/deploy_locker'
```Edit your `config/deploy.rb`:
```ruby
before 'deploy:starting', 'deploy:lock'
after 'deploy:finished', 'deploy:unlock'
after 'deploy:failed', 'deploy:unlock'
```## Alternatives
Here is a list of other libraries which provides similar functionarily:
- [capistrano_deploy_lock](https://github.com/ndbroadbent/capistrano_deploy_lock)
- [capistrano-deploy-lock](https://github.com/maruf-freelancer/capistrano-deploy-lock)
- [capistrano-deploylock](https://github.com/tetuyoko/capistrano-deploylock)
- [caplock](https://github.com/Druwerd/caplock)## License
Available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
Copyright (c) 2017 DeNA Co., Ltd., IKEDA Kiyoshi