GemsuranceSlack
Rake task to run Gemsurance and send gems alerts/warnings to Slack
Installation
Add this line to your application's Gemfile:
gem 'gemsurance_slack'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gemsurance_slack
Don't forget to set Slack settings environment variables into your project
SLACK_WEBHOOK_URL="https://hooks.slack.com/services/..."
SLACK_CHANNEL="#mychannel"
SLACK_APP_NAME="My application name"
Usage
You can manually run rake gemsurance_slack:check
in your project.
If everything is well setup, you should receive Gemsurance warnings/alerts in your Slack channel.
Slack notifications example
Heroku scheduler setup
To be daily inform about your project gems status running on Heroku,
- set Slack config variables
heroku config:set SLACK_WEBHOOK_URL="https://hooks.slack.com/services/..."
heroku config:set SLACK_CHANNEL="#mychannel"
heroku config:set SLACK_APP_NAME="My application name"
- add the Heroku scheduler addon and open it
heroku addons:add scheduler:standard
heroku addons:open scheduler
- add a job, set the task with
rake gemsurance_slack:check
, select the frequency and save.
Now you'll be periodically inform in your Slack channel about your project gems status.
Clockwork setup
If you're using the scheduling gem Clockwork, you just have to add this line in your clockwork config file.
every(1.day, 'Check gems status', :at => '00:30') { GemsuranceSlack.check_and_notify }
Cron setup
For a daily check at midnight by using Cron, edit your crontab file and add this line :
00 00 * * * cd /Users/you/projects/myrailsapp && /usr/local/bin/rake RAILS_ENV=production gemsurance_slack:check
Contributing
- Fork it ( https://github.com/gatemedia/gemsurance_slack/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