CircleCI Deployment Notifier
Sends deployment notifications based on deployments that occur on CircleCI.
Assumptions:
- Using CircleCI.
- Using Github.
- Using Slack for notifications.
You can also:
- Deploy releases that are tagged using Github Releases.
Installation
Requires Ruby 2.0.0 or higher.
gem install circleci_deployment_notifier
Usage
Add the following lines to your circle.yml
in the deployments section:
gem install circleci_deployment_notifier
circleci_deployment_notify_slack -a "Application Name" -u "https://hooks.slack.com/services/WEBHOOK"
Here's an example deployment section from circle.yml
:
deployment:
staging:
branch: master
commands:
- # TODO: something to deploy the application to staging
- gem install circleci_deployment_notifier
- circleci_deployment_notify_slack -a "Application Staging" -u "https://hooks.slack.com/services/WEBHOOK"
production:
tag: /v[0-9]+\.[0-9]+\.[0-9]+/
owner: MyOrganization
commands:
- # TODO: something to deploy the application to production
- gem install circleci_deployment_notifier
- circleci_deployment_notify_slack -a "Application Production" -u "https://hooks.slack.com/services/WEBHOOK"
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/RobinDaugherty/circleci_deployment_notifier.
License
The gem is available as open source under the terms of the MIT License.