Blog by Railsware

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:

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:

Capistrano Calendar

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

Features

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!

Exit mobile version