small refactoring skype messages

This commit is contained in:
Alexander Machehin 2015-06-29 18:40:25 +05:00
parent 4b73baad1e
commit 12f33b4a6d
1 changed files with 11 additions and 9 deletions

View File

@ -18,14 +18,15 @@ Capistrano::Configuration.instance(:must_exist).load do
if skype_send_notification if skype_send_notification
environment_string = env environment_string = env
if self.respond_to?(:stage) # if self.respond_to?(:stage)
environment_string = "#{stage} (#{env})" # environment_string = "#{stage} (#{env})"
end # end
environment_string = domain if self.respond_to?(:domain)
on_rollback do on_rollback do
send("Cancelled deployment of #{deployment_name} to #{environment_string}.\n#{'#'*60}") send("Cancelled deployment of #{deployment_name} to #{environment_string}\n#{'#'*60}")
end end
send("#{'#'*60}\nDeploying #{deployment_name} to #{environment_string}#{fetch(:skype_with_migrations, '')}.") send("#{'#'*60}\nDeploying #{deployment_name} to #{environment_string}#{fetch(:skype_with_migrations, '')}")
end end
end end
@ -33,11 +34,12 @@ Capistrano::Configuration.instance(:must_exist).load do
if skype_send_notification if skype_send_notification
environment_string = env environment_string = env
if self.respond_to?(:stage) # if self.respond_to?(:stage)
environment_string = "#{stage} (#{env})" # environment_string = "#{stage} (#{env})"
end # end
environment_string = domain if self.respond_to?(:domain)
elapsed = (Time.now - start_time).to_i elapsed = (Time.now - start_time).to_i
send("(#{elapsed} secs) Finished deploying #{deployment_name} to #{environment_string}#{fetch(:skype_with_migrations, '')}.\n#{'#'*60}") send("(#{elapsed} secs) Finished deploying #{deployment_name} to #{environment_string}#{fetch(:skype_with_migrations, '')}\n#{'#'*60}")
end end
end end