From cb9431e1b0bde90430a81605e59e89372b2715ee Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Wed, 25 Mar 2015 22:03:05 +0500 Subject: [PATCH] show deploy time in a skype chat --- lib/recipes/skype.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/recipes/skype.rb b/lib/recipes/skype.rb index c73c9b5d9..562793345 100644 --- a/lib/recipes/skype.rb +++ b/lib/recipes/skype.rb @@ -3,6 +3,7 @@ require 'skype' Capistrano::Configuration.instance(:must_exist).load do Skype.config app_name: 'test-message' set :skype_send_notification, true + set :start_time, Time.now namespace :skype do task :trigger_notification do @@ -35,8 +36,8 @@ Capistrano::Configuration.instance(:must_exist).load do if self.respond_to?(:stage) environment_string = "#{stage} (#{env})" end - - send("Finished deploying #{deployment_name} to #{environment_string}#{fetch(:skype_with_migrations, '')}.\n#{'#'*60}") + elapsed = (Time.now - start_time).to_i + send("(#{elapsed} secs) Finished deploying #{deployment_name} to #{environment_string}#{fetch(:skype_with_migrations, '')}.\n#{'#'*60}") end end