capistrano-ikachan 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/capistrano/ikachan/version.rb +1 -1
- data/lib/capistrano/tasks/ikachan.rake +12 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc7defac3685a27dfc795a29f28598cc0866243e
|
4
|
+
data.tar.gz: 974d5cebb4bb7f253b0e2b291856aca5621222b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6279caba84a4e2881815ad819ca38529b813df28b8a987dd468b0b5cfe56ae6fc63102cbdff009e3b29af602e2f798745adc9a605b0e1548cd2bec2b59d6dd82
|
7
|
+
data.tar.gz: f96a2df041db5e3fe644ecbd137b07b7c277138c8fa4a42cfdf22c76b7bafb0fb0bcdb2f58a43dd2903980db6a2edcf1f434c50345572505f5d8785e870fca85
|
data/README.md
CHANGED
@@ -30,11 +30,11 @@ require 'capistrano/ikachan'
|
|
30
30
|
config.rb:
|
31
31
|
|
32
32
|
```ruby
|
33
|
-
set
|
34
|
-
set
|
33
|
+
set ikachan_channel, 'ikachan'
|
34
|
+
set ikachan_server, 'http://ikachan.example.com'
|
35
35
|
|
36
|
-
before 'deploy:starting', '
|
37
|
-
after 'deploy:finished', '
|
36
|
+
before 'deploy:starting', 'ikachan:notify_start'
|
37
|
+
after 'deploy:finished', 'ikachan:notify_end'
|
38
38
|
```
|
39
39
|
|
40
40
|
Contributing
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'string-irc'
|
2
2
|
|
3
|
-
namespace :
|
3
|
+
namespace :ikachan do
|
4
4
|
start = Time.now
|
5
5
|
|
6
|
-
set :
|
7
|
-
set :
|
8
|
-
set :
|
6
|
+
set :ikachan_channel, 'ikachan'
|
7
|
+
set :ikachan_server, 'http://ikachan.example.com'
|
8
|
+
set :ikachan_message_type, 'notice'
|
9
9
|
|
10
10
|
set :username, -> {
|
11
11
|
username = `git config --get user.name`.strip
|
@@ -23,30 +23,30 @@ namespace :irc do
|
|
23
23
|
StringIrc.new(stage).send(color)
|
24
24
|
}
|
25
25
|
|
26
|
-
set :
|
26
|
+
set :ikachan_start_message, -> {
|
27
27
|
state = StringIrc.new('started').orange.bold.to_s
|
28
28
|
"#{fetch(:username)} #{state} deployment to #{fetch(:destination)} of #{fetch(:application)} from #{fetch(:branch)} by cap"
|
29
29
|
}
|
30
30
|
|
31
|
-
set :
|
31
|
+
set :ikachan_end_message, -> {
|
32
32
|
elapse_time = "(#{sprintf('%.2f', Time.now - start)} sec)"
|
33
33
|
state = StringIrc.new('finished').green.bold.to_s
|
34
34
|
"#{fetch(:username)} #{state} deployment to #{fetch(:destination)} by cap #{elapse_time}"
|
35
35
|
}
|
36
36
|
|
37
|
-
def
|
38
|
-
channel = fetch(:
|
39
|
-
host = fetch(:
|
40
|
-
type = fetch(:
|
37
|
+
def notify_to_ikachan(message)
|
38
|
+
channel = fetch(:ikachan_channel)
|
39
|
+
host = fetch(:ikachan_server)
|
40
|
+
type = fetch(:ikachan_message_type)
|
41
41
|
`curl -s -F channel=\##{channel} #{host}/join`
|
42
42
|
`curl -s -F channel=\##{channel} -F message="#{message}" #{host}/#{type}`
|
43
43
|
end
|
44
44
|
|
45
45
|
task :notify_start do
|
46
|
-
|
46
|
+
notify_to_ikachan fetch(:ikachan_start_message)
|
47
47
|
end
|
48
48
|
|
49
49
|
task :notify_end do
|
50
|
-
|
50
|
+
notify_to_ikachan fetch(:ikachan_end_message)
|
51
51
|
end
|
52
52
|
end
|