Hire Us

Posting delivery events to Google Calendar

Introduction

One 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

So we “thinked differently”© and made next simple solution.

Google Calendar

What’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 Calendar

We extracted our calendar recipes and released as
capistrano-calendar gem.

Features

  • 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 work

Event 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"

Installation

Install gem:

gem install capistrano-calendar

To activate capistrano-calendar recipes, add next line into your project Capfile:

require 'capistrano/calendar/recipes'

Add at least minimal calendar configuration to config/deploy.rb:

set(:calendar_username, 'vasya.pupkin@gmail.com')
set(:calendar_password, 'qwery123456')
set(:calendar_name) do
  "Blog [#{stage}]"
end
set(:calendar_event_name) do
  "Deployed #{real_revision}"
end 

after 'deploy', 'calendar:create_event'

Take a look into README file to get more advanced configuration sample and a full list of options.

Mobile

Your customer will be happy to have actual deployment information in his calendar on the phone, and it’s quite simple. Just share this calendar to your customer. Then he should add and sync this calendar on his phone.
Enjoy!