capistrano-ikachan 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc7defac3685a27dfc795a29f28598cc0866243e
4
- data.tar.gz: 974d5cebb4bb7f253b0e2b291856aca5621222b1
3
+ metadata.gz: c9c1de7a16b6e89b8f1c42639be59965c80f32b9
4
+ data.tar.gz: 66357471831d4c5a89ea5998cb053ac4884b1e43
5
5
  SHA512:
6
- metadata.gz: 6279caba84a4e2881815ad819ca38529b813df28b8a987dd468b0b5cfe56ae6fc63102cbdff009e3b29af602e2f798745adc9a605b0e1548cd2bec2b59d6dd82
7
- data.tar.gz: f96a2df041db5e3fe644ecbd137b07b7c277138c8fa4a42cfdf22c76b7bafb0fb0bcdb2f58a43dd2903980db6a2edcf1f434c50345572505f5d8785e870fca85
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
- This is capistrano task for capistrano 3.
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
- gem 'capistrano-ikachan'
14
+ ```ruby
15
+ gem 'capistrano-ikachan'
16
+ ```
12
17
 
13
18
  And then execute:
14
19
 
15
- $ bundle
20
+ ```sh
21
+ $ bundle
22
+ ```
16
23
 
17
24
  Or install it yourself as:
18
25
 
19
- $ gem install capistrano-ikachan
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
- before 'deploy:starting', 'ikachan:notify_start'
37
- after 'deploy:finished', 'ikachan:notify_end'
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/<my-github-username>/capistrano-ikachan/fork )
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)
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Ikachan
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
@@ -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
- when 'production' then :rainbow
20
- when 'staging' then :light_blue
21
- else :grey
22
- end
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
- state = StringIrc.new('started').orange.bold.to_s
28
- "#{fetch(:username)} #{state} deployment to #{fetch(:destination)} of #{fetch(:application)} from #{fetch(:branch)} by cap"
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 :ikachan_end_message, -> {
40
+ set :ikachan_success_message, -> {
32
41
  elapse_time = "(#{sprintf('%.2f', Time.now - start)} sec)"
33
- state = StringIrc.new('finished').green.bold.to_s
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 :notify_end do
50
- notify_to_ikachan fetch(:ikachan_end_message)
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.2
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-01-24 00:00:00.000000000 Z
11
+ date: 2014-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: string-irc