capistrano-ikachan 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +27 -7
- data/lib/capistrano/ikachan/version.rb +1 -1
- data/lib/capistrano/tasks/ikachan.rake +23 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9c1de7a16b6e89b8f1c42639be59965c80f32b9
|
4
|
+
data.tar.gz: 66357471831d4c5a89ea5998cb053ac4884b1e43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58a056c97a57a645435c95176352f06be03be3b2fb3f91be7ba3a24af37bd69c1280b24be56742816486f89900934e982f710a629a4f0ce18ffe2a931f33aadb
|
7
|
+
data.tar.gz: edf5bc7b6f09bb39c4f3c754b461144972cc89e88075276fb93b84aeda1cf2b10c1fdbb8776a08d444b0a051f75bde3e6eaaea304a651bee2900e984ab5df0be
|
data/README.md
CHANGED
@@ -1,22 +1,31 @@
|
|
1
1
|
Capistrano::Ikachan
|
2
2
|
===================
|
3
3
|
|
4
|
-
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/capistrano-ikachan.png)][gem]
|
5
|
+
[gem]: https://rubygems.org/gems/capistrano-ikachan
|
6
|
+
|
7
|
+
Irc notification tasks by The Ikachan for Capistrano v3.
|
5
8
|
|
6
9
|
Installation
|
7
10
|
------------
|
8
11
|
|
9
12
|
Add this line to your application's Gemfile:
|
10
13
|
|
11
|
-
|
14
|
+
```ruby
|
15
|
+
gem 'capistrano-ikachan'
|
16
|
+
```
|
12
17
|
|
13
18
|
And then execute:
|
14
19
|
|
15
|
-
|
20
|
+
```sh
|
21
|
+
$ bundle
|
22
|
+
```
|
16
23
|
|
17
24
|
Or install it yourself as:
|
18
25
|
|
19
|
-
|
26
|
+
```sh
|
27
|
+
$ gem install capistrano-ikachan
|
28
|
+
```
|
20
29
|
|
21
30
|
Usage
|
22
31
|
-----
|
@@ -33,15 +42,26 @@ config.rb:
|
|
33
42
|
set ikachan_channel, 'ikachan'
|
34
43
|
set ikachan_server, 'http://ikachan.example.com'
|
35
44
|
|
36
|
-
|
37
|
-
after 'deploy:
|
45
|
+
after 'deploy:starting', 'ikachan:notify_start'
|
46
|
+
after 'deploy:finishing', 'ikachan:notify_success'
|
47
|
+
after 'deploy:finishing_rollback', 'ikachan:notify_failure'
|
38
48
|
```
|
39
49
|
|
40
50
|
Contributing
|
41
51
|
------------
|
42
52
|
|
43
|
-
1. Fork it ( http://github.com
|
53
|
+
1. Fork it ( http://github.com/linyows/capistrano-ikachan/fork )
|
44
54
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
45
55
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
46
56
|
4. Push to the branch (`git push origin my-new-feature`)
|
47
57
|
5. Create new Pull Request
|
58
|
+
|
59
|
+
Authors
|
60
|
+
-------
|
61
|
+
|
62
|
+
- [linyows](https://github.com/linyows)
|
63
|
+
|
64
|
+
License
|
65
|
+
-------
|
66
|
+
|
67
|
+
The MIT License (MIT)
|
@@ -13,25 +13,33 @@ namespace :ikachan do
|
|
13
13
|
username
|
14
14
|
}
|
15
15
|
|
16
|
+
set :start_icon, -> { StringIrc.new('✔').orange.to_s }
|
17
|
+
set :failure_icon, -> { StringIrc.new('✘').red.to_s }
|
18
|
+
set :success_icon, -> { StringIrc.new('✔').light_green.to_s }
|
19
|
+
|
16
20
|
set :destination, -> {
|
17
21
|
stage = "#{fetch(:stage)}"
|
18
22
|
color = case stage
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
+
when 'production' then :rainbow
|
24
|
+
when 'staging' then :light_blue
|
25
|
+
when 'sandbox' then :yellow
|
26
|
+
when 'development' then :purple
|
27
|
+
else :grey
|
28
|
+
end
|
23
29
|
StringIrc.new(stage).send(color)
|
24
30
|
}
|
25
31
|
|
26
32
|
set :ikachan_start_message, -> {
|
27
|
-
|
28
|
-
|
33
|
+
"#{fetch(:application)}: #{fetch(:start_icon)} started deploying to #{fetch(:destination)} of #{fetch(:branch)} by #{fetch(:username)} #{elapse_time}"
|
34
|
+
}
|
35
|
+
|
36
|
+
set :ikachan_failure_message, -> {
|
37
|
+
"#{fetch(:application)}: #{fetch(:failure_icon)} failed deploying to #{fetch(:destination)} of #{fetch(:branch)} by #{fetch(:username)} #{elapse_time}"
|
29
38
|
}
|
30
39
|
|
31
|
-
set :
|
40
|
+
set :ikachan_success_message, -> {
|
32
41
|
elapse_time = "(#{sprintf('%.2f', Time.now - start)} sec)"
|
33
|
-
|
34
|
-
"#{fetch(:username)} #{state} deployment to #{fetch(:destination)} by cap #{elapse_time}"
|
42
|
+
"#{fetch(:application)}: #{fetch(:success_icon)} successful deployment to #{fetch(:destination)} of #{fetch(:branch)} by #{fetch(:username)} #{elapse_time}"
|
35
43
|
}
|
36
44
|
|
37
45
|
def notify_to_ikachan(message)
|
@@ -46,7 +54,11 @@ namespace :ikachan do
|
|
46
54
|
notify_to_ikachan fetch(:ikachan_start_message)
|
47
55
|
end
|
48
56
|
|
49
|
-
task :
|
50
|
-
notify_to_ikachan fetch(:
|
57
|
+
task :notify_failure do
|
58
|
+
notify_to_ikachan fetch(:ikachan_failure_message)
|
59
|
+
end
|
60
|
+
|
61
|
+
task :notify_success do
|
62
|
+
notify_to_ikachan fetch(:ikachan_success_message)
|
51
63
|
end
|
52
64
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-ikachan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- linyows
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: string-irc
|