{"id":843,"date":"2011-11-10T15:37:04","date_gmt":"2011-11-10T13:37:04","guid":{"rendered":"http:\/\/blog.railsware.com\/?p=843"},"modified":"2021-08-16T11:42:00","modified_gmt":"2021-08-16T08:42:00","slug":"posting-delivery-events-to-google-calendar","status":"publish","type":"post","link":"https:\/\/railsware.com\/blog\/posting-delivery-events-to-google-calendar\/","title":{"rendered":"Posting delivery events to Google Calendar"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p>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:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>hard to filter notification emails<\/li><li>hard to track deploment history<\/li><li>newly added person can&#8217;t observe old events<\/li><\/ul>\n\n\n\n<p>So we &#8220;thinked differently&#8221;\u00a9 and made next simple solution.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Google Calendar<\/h2>\n\n\n\n<p>What&#8217;s about using Google Calendar as event storage? It has many useful features:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>stores any event history<\/li><li>provides chronological event representation for free<\/li><li>we can easily subscribe\/unsubscribe to\/from notification feed<\/li><li>calendar can be easily customized in different ways(e.g. colors, size)<\/li><li>you can embed calendar directly into any html-page via iframe<\/li><li>you can access your calendar on any android\/iphone device<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Capistrano Calendar<\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"232\" height=\"300\" src=\"https:\/\/railsware.com\/blog\/wp-content\/uploads\/2011\/11\/google-calendar-event-232x300.png\" alt=\"\" class=\"wp-image-1002\" title=\"google-calendar-event\" srcset=\"https:\/\/railsware.com\/blog\/wp-content\/uploads\/2011\/11\/google-calendar-event-232x300.png 232w, https:\/\/railsware.com\/blog\/wp-content\/uploads\/2011\/11\/google-calendar-event.png 433w\" sizes=\"auto, (max-width: 232px) 100vw, 232px\" \/><\/figure><\/div>\n\n\n\n<p>We extracted our calendar recipes and released as<br><a href=\"https:\/\/github.com\/railsware\/capistrano-calendar\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">capistrano-calendar<\/a> gem.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h3 class=\"wp-block-heading\">Features<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Posting events to <strong>multiple<\/strong> google calendars<\/li><li>Automatic calendar creation if it does not exist<\/li><li>Ability to dynamically choose calendar name according to your needs (e.g. production\/staging calendar)<\/li><li>Ability to customize host for calendar event creation<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">How does it work<\/h3>\n\n\n\n<p>Event creation takes some time so we decided to run it in background. And it&#8217;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 <strong>calendar_runner<\/strong> option. So you need to install <strong>capistrano-calendar<\/strong> on that server too.<\/p>\n\n\n\n<p>Recipe <strong>calendar:create_event<\/strong> is pretty simple. It collects all calendar information from Capistrano configuration and pass them to <strong>capistrano-calendar<\/strong> binary(from our gem):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">  * == Currently executing `calendar:create_event'\n  * executing \"capistrano-calendar _0.1.0_ create_event UnVkb2xwaCBDYXJ0aWVyICgxOTA04oCTMTk5NCkgd2FzIGFuIEF1c3RyaWFuIHRlbGV2aXNpb24gZGlyZWN0b3Igd2hvIHdvcmtlZCBwcmVkb21pbmFudGx5IGluIEJyaXRpc2ggdGVsZXZpc2lvbiwgZXhjbHVzaXZlbHkgZm9yIHRoZSBCQkMu\"<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Installation<\/h3>\n\n\n\n<p>Install gem:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">gem install capistrano-calendar<\/pre>\n\n\n\n<p>To activate <strong>capistrano-calendar<\/strong> recipes, add next line into your project <em>Capfile<\/em>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">require 'capistrano\/calendar\/recipes'<\/pre>\n\n\n\n<p>Add at least minimal calendar configuration to <em>config\/deploy.rb<\/em>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">set(:calendar_username, 'vasya.pupkin@gmail.com')\nset(:calendar_password, 'qwery123456')\nset(:calendar_name) do\n  \"Blog [#{stage}]\"\nend\nset(:calendar_event_name) do\n  \"Deployed #{real_revision}\"\nend \n\nafter 'deploy', 'calendar:create_event'<\/pre>\n\n\n\n<p>Take a look into <a href=\"https:\/\/github.com\/railsware\/capistrano-calendar\/blob\/master\/README.md\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">README<\/a> file to get more advanced configuration sample and a full list of options.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Mobile<\/h3>\n\n\n\n<p>Your customer will be happy to have actual deployment information in his calendar on the phone, and it&#8217;s quite simple. Just share this calendar to your customer. Then he should add and sync this calendar on his phone.<br>Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 emailshard to track deploment historynewly added person can&#8217;t observe old events So we &#8220;thinked differently&#8221;\u00a9 and made next simple solution&#8230;.<\/p>\n","protected":false},"author":19,"featured_media":1741,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3],"tags":[],"coauthors":["Andriy Yanko"],"class_list":["post-843","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development"],"acf":[],"aioseo_notices":[],"categories_data":[{"name":"Engineering","link":"https:\/\/railsware.com\/blog?category=development"}],"post_thumbnails":"https:\/\/railsware.com\/blog\/wp-content\/uploads\/2011\/11\/google-calendar-event-232x300.png","amp_enabled":true,"_links":{"self":[{"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/posts\/843","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/comments?post=843"}],"version-history":[{"count":56,"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/posts\/843\/revisions"}],"predecessor-version":[{"id":14088,"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/posts\/843\/revisions\/14088"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/media\/1741"}],"wp:attachment":[{"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/media?parent=843"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/categories?post=843"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/tags?post=843"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/railsware.com\/blog\/wp-json\/wp\/v2\/coauthors?post=843"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}