capistrano3-idobata 0.0.3 → 0.0.4

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: 3da4b475ea0ca4aeb756a04f032922784802eb53
4
- data.tar.gz: 134cbbab52d2701d4404bc76197eca4c93c14470
3
+ metadata.gz: 1b5b9cd0e91d22fb7c5da08582b8f3be6bebcb1f
4
+ data.tar.gz: 14590c27331c2eb50c6054c6f31bf74964eafceb
5
5
  SHA512:
6
- metadata.gz: 0cc39c01cf61f69237579c4213d3cb797da0fc93a518a377961c7ee5cd7109033f8931d20c477f60db527bd4d0196237e4a501b68b6ac1259acdf28b6136665e
7
- data.tar.gz: 07af0556d82d443f9ec83c4c43fbb08d57e7ff3a2c09e5db348f2857d07aab8d40954444868833d135c7ce7fc040fb10fcce4ee5c082a452277dbe88d7f31a32
6
+ metadata.gz: cf8e184d86fcedae24b6e4f77c8804a2a1a82b0abe8da97b3ede17e78ddbdf24e68ab2f090a4ba13a63b934621bac699558f6c6b45ba18f76dd05f2da93098eb
7
+ data.tar.gz: c10062b49a572acf3341e014ab6707a91752004e367cafb7a108818dcda6d8573d948093384dbc94e6accc0ecbc9a8eaa01e16aa8fc9e002b4c8d7a34702ef29
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Capistrano3::Idobata
2
2
 
3
- Send deployment notification to Idobata :rocket:
3
+ Send deployment notification to [Idobata](https://idobata.io) :rocket:
4
+
5
+ ![screenshot.png](image/screenshot.png)
4
6
 
5
7
  ## Installation
6
8
 
@@ -12,15 +14,15 @@ gem 'capistrano3-idobata'
12
14
  require 'capistrano3/idobata'
13
15
 
14
16
  # config/deploy.rb
15
- set :idobata_hook_url, 'https://idobata.io/hook/generic/XXXXX'
16
- set :repository_url, 'https://github.com/XXXXX/XXXXX'
17
+ set :idobata_hook_url, 'https://idobata.io/hook/generic/xxxxx'
18
+ set :repository_url, 'https://github.com/xxxxx/xxxxx'
17
19
  ```
18
20
 
19
- ## Adding any label to a notification
21
+ ## Adding some labels
20
22
 
21
23
  ```ruby
22
24
  # config/deploy.rb
23
- set :idobata_additional_label, 'NOOP'
25
+ set :idobata_additional_label, %w(NOOP)
24
26
  ```
25
27
 
26
28
  ## Contributing
Binary file
@@ -1,5 +1,5 @@
1
1
  module Capistrano3
2
2
  module Idobata
3
- VERSION = "0.0.3"
3
+ VERSION = '0.0.4'
4
4
  end
5
5
  end
@@ -4,24 +4,24 @@ namespace :idobata do
4
4
  end
5
5
 
6
6
  namespace :notify do
7
- task :started do
8
- message = "#{deployer} started deploying"
9
- Idobata::Message.create(format: :html, source: message, label: label(type: :info))
7
+ task :starting do
8
+ source = "#{deployer} started deployment"
9
+ send_notification(source: source, type: :info)
10
10
  end
11
11
 
12
12
  task :finished do
13
- branch_url = "#{fetch(:repository_url)}/tree/#{fetch(:branch)}"
14
- revision_url = "#{fetch(:repository_url)}/commit/#{fetch(:current_revision)}"
13
+ branch_url = "#{fetch(:repository_url)}/tree/#{fetch(:branch)}"
14
+ revision_url = "#{fetch(:repository_url)}/commit/#{fetch(:current_revision)}"
15
15
 
16
- message = "Branch <a href='#{branch_url}'>#{fetch(:branch)}</a> "
17
- message += "(at <a href='#{revision_url}'>#{fetch(:current_revision)}</a>) "
18
- message += "was deployed by #{deployer}"
19
- Idobata::Message.create(format: :html, source: message, label: label(type: :success))
16
+ source = "Branch <a href='#{branch_url}'>#{fetch(:branch)}</a> "
17
+ source += "(at <a href='#{revision_url}'>#{fetch(:current_revision)}</a>) "
18
+ source += "was deployed by #{deployer}"
19
+ send_notification(source: source, type: :success)
20
20
  end
21
21
 
22
22
  task :failed do
23
- message = "Deployment by #{deployer} has failed"
24
- Idobata::Message.create(format: :html, source: message, label: label(type: :danger))
23
+ source = "Deployment by #{deployer} has failed"
24
+ send_notification(source: source, type: :danger)
25
25
  end
26
26
  end
27
27
  end
@@ -29,7 +29,7 @@ end
29
29
  namespace :deploy do
30
30
  before 'starting', 'idobata:setup'
31
31
 
32
- after 'started', 'idobata:notify:started'
32
+ after 'starting', 'idobata:notify:starting'
33
33
  after 'finished', 'idobata:notify:finished'
34
34
  after 'failed', 'idobata:notify:failed'
35
35
  end
@@ -38,8 +38,11 @@ def deployer
38
38
  ENV['DEPLOYER'] || `git config user.name`.chomp
39
39
  end
40
40
 
41
- def label(type:)
42
- (['Deploy', fetch(:stage)] + Array(fetch(:idobata_additional_label))).map do |text|
43
- { type: type, text: text }
44
- end
41
+ def send_notification(source:, type:)
42
+ label =
43
+ (['Deploy', fetch(:stage)] + Array(fetch(:idobata_additional_label))).collect do |text|
44
+ { type: type, text: text }
45
+ end
46
+ Idobata::Message.create(format: :html, source: source, label: label)
47
+ rescue Faraday::ClientError
45
48
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano3-idobata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - kirikiriyamama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-02 00:00:00.000000000 Z
11
+ date: 2016-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -85,6 +85,7 @@ files:
85
85
  - README.md
86
86
  - Rakefile
87
87
  - capistrano3-idobata.gemspec
88
+ - image/screenshot.png
88
89
  - lib/capistrano3-idobata.rb
89
90
  - lib/capistrano3/idobata.rb
90
91
  - lib/capistrano3/idobata/version.rb
@@ -109,8 +110,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
110
  version: '0'
110
111
  requirements: []
111
112
  rubyforge_project:
112
- rubygems_version: 2.4.5
113
+ rubygems_version: 2.5.1
113
114
  signing_key:
114
115
  specification_version: 4
115
116
  summary: Send deployment notification to Idobata
116
117
  test_files: []
118
+ has_rdoc: