Capistrano extension for notify to ChatWork
Add the library to your Gemfile
:
group :development do
gem 'capistrano-chatwork', require: false
end
And load it into your deployment script config/deploy.rb
:
require 'capistrano-chatwork'
Add ChatWork configuration:
set :chatwork_api_token, 'YOUR_API_TOKEN'
set :chatwork_room_id, 'YOUR_ROOM_ID'
You can modify any of the following Capistrano variables in your deploy.rb
config.
chatwork_api_token
- Set ChatWork API Token. Defaults toENV['CHATWORK_API_TOKEN']
.chatwork_room_id
- Set ChatWork room id for notify message.
chatwork_deploy_started_message
- Set message when deployment is started. Defaults to"#{user} is deploying #{deployment_name} to #{rails_env}"
chatwork_deploy_finished_message
- Set message when deployment is finished. Defaults to"#{user} finished deploying #{deployment_name} to #{rails_env}"
chatwork_deploy_failed_message
- Set message when deployment is failed. Defaults to"#{user} failed deployment of #{deployment_name} to #{rails_env}"
Skip notification when set to false, nil or blank string to message variables
# Skip deploy start notification
set :chatwork_deploy_started_message, false
# Skip deploy finished notification
set :chatwork_deploy_finished_message, nil
# Skip deploy failed notification
set :chatwork_deploy_failed_message, ''
user
- Get user name from git config, or environment variables.deployment_name
- Get frombranch
and/orapplication
of Capistrano variables.rails_env
- Get fromrails_env
of Capistrano variables.
- Fork it
- 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 new Pull Request
Copyright (c) 2013 Kazuya Takeshima. See LICENSE for details.