talking-capistrano 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +0 -2
- data/lib/talking-capistrano/version.rb +1 -1
- data/lib/talking-capistrano.rb +6 -11
- metadata +1 -1
data/Gemfile
CHANGED
data/lib/talking-capistrano.rb
CHANGED
@@ -7,20 +7,22 @@ module TalkingCapistrano
|
|
7
7
|
require 'skype_script_invoker'
|
8
8
|
|
9
9
|
class << self;
|
10
|
-
attr_accessor :topic;
|
10
|
+
attr_accessor :topic;
|
11
|
+
attr_accessor :skyper;
|
12
|
+
|
11
13
|
end
|
12
14
|
|
13
15
|
def self.set_notify(topic_exist)
|
14
16
|
@notify = topic_exist
|
15
17
|
@topic = topic_exist if topic_exist
|
18
|
+
@skyper = SkypeScriptInvoker.new(@topic)
|
16
19
|
end
|
17
20
|
def self.notify?
|
18
21
|
@notify
|
19
22
|
end
|
20
23
|
|
21
24
|
def self.notify(text)
|
22
|
-
|
23
|
-
skyper.send_message(pad_text text) unless @topic.nil?
|
25
|
+
@skyper.send_message(pad_text text) unless @topic.nil?
|
24
26
|
end
|
25
27
|
|
26
28
|
def self.pad_text(text)
|
@@ -38,7 +40,6 @@ module TalkingCapistrano
|
|
38
40
|
end
|
39
41
|
|
40
42
|
def self.say_deploy_started
|
41
|
-
|
42
43
|
get_item(:say_deploy_started).sub! "ENV", @local_rails_env
|
43
44
|
end
|
44
45
|
def self.say_deploy_completed
|
@@ -80,9 +81,7 @@ Capistrano::Configuration.instance.load do
|
|
80
81
|
task :update_code, :except => { :no_release => true } do
|
81
82
|
on_rollback do
|
82
83
|
`#{say_command} #{TalkingCapistrano::say_deploy_failed} -v #{TalkingCapistrano::say_speaker_name} &`;
|
83
|
-
|
84
|
-
TalkingCapistrano::SkypeNotification.notify(TalkingCapistrano::say_deploy_failed)
|
85
|
-
end
|
84
|
+
TalkingCapistrano::SkypeNotification.notify(TalkingCapistrano::say_deploy_failed)
|
86
85
|
run "rm -rf #{release_path}; true"
|
87
86
|
end
|
88
87
|
strategy.deploy!
|
@@ -96,9 +95,7 @@ Capistrano::Configuration.instance.load do
|
|
96
95
|
TalkingCapistrano::SkypeNotification.set_notify(fetch(:skype_topic, false))
|
97
96
|
end
|
98
97
|
task :send_about_to_deploy do
|
99
|
-
if TalkingCapistrano::SkypeNotification.notify?
|
100
98
|
TalkingCapistrano::SkypeNotification.notify(TalkingCapistrano::say_deploy_started)
|
101
|
-
end
|
102
99
|
end
|
103
100
|
end
|
104
101
|
end
|
@@ -115,9 +112,7 @@ Capistrano::Configuration.instance.load do
|
|
115
112
|
# Say + Skype notifications on deploy stages - hack to avoid stack too deep exception
|
116
113
|
after "deploy" do
|
117
114
|
`#{say_command} #{TalkingCapistrano::say_deploy_completed} -v '#{TalkingCapistrano::say_speaker_name}' &`
|
118
|
-
if TalkingCapistrano::SkypeNotification.notify?
|
119
115
|
TalkingCapistrano::SkypeNotification.notify(TalkingCapistrano::say_deploy_completed)
|
120
|
-
end
|
121
116
|
end
|
122
117
|
|
123
118
|
end
|