IntroductionOne day our client asked us about product deployment notification. Initially we wanted to use mail-list or create special skype chat, but it turned out to be unreliable and inconvenient:
- hard to filter notification emails
- hard to track deploment history
- newly added person can’t observe old events
Google CalendarWhat’s about using Google Calendar as event storage? It has many useful features:
- stores any event history
- provides chronological event representation for free
- we can easily subscribe/unsubscribe to/from notification feed
- calendar can be easily customized in different ways(e.g. colors, size)
- you can embed calendar directly into any html-page via iframe
- you can access your calendar on any android/iphone device
Capistrano CalendarWe extracted our calendar recipes and released as capistrano-calendar gem.
- Posting events to multiple google calendars
- Automatic calendar creation if it does not exist
- Ability to dynamically choose calendar name according to your needs (e.g. production/staging calendar)
- Ability to customize host for calendar event creation
How does it workEvent creation takes some time so we decided to run it in background. And it’s better to spawn it on some server. By default this is first application server. But you can set special host for calendar event creation using calendar_runner option. So you need to install capistrano-calendar on that server too.Recipe calendar:create_event is pretty simple. It collects all calendar information from Capistrano configuration and pass them to capistrano-calendar binary(from our gem):
* == Currently executing `calendar:create_event'
* executing "capistrano-calendar _0.1.0_ create_event UnVkb2xwaCBDYXJ0aWVyICgxOTA04oCTMTk5NCkgd2FzIGFuIEF1c3RyaWFuIHRlbGV2aXNpb24gZGlyZWN0b3Igd2hvIHdvcmtlZCBwcmVkb21pbmFudGx5IGluIEJyaXRpc2ggdGVsZXZpc2lvbiwgZXhjbHVzaXZlbHkgZm9yIHRoZSBCQkMu"
To activate capistrano-calendar recipes, add next line into your project Capfile:
gem install capistrano-calendar
Add at least minimal calendar configuration to config/deploy.rb:
Take a look into README file to get more advanced configuration sample and a full list of options.
after 'deploy', 'calendar:create_event'