capistrano-slackify 2.6.1 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb3fa384bc27b780d15af96cd889c8b8ee950014
4
- data.tar.gz: c61d527edf8eddc4bcc0128fade1a36fb49a264e
3
+ metadata.gz: 89a12b4e67a8be244b4b52b3849fc9b71abebcf5
4
+ data.tar.gz: bb5e6322dbeb1b0bf76f95923398ff165d7db361
5
5
  SHA512:
6
- metadata.gz: 5ef42e7abc717b0db2da30851c5b20004645dc22a574ca6b17d1e50243667a9e4cb048eeeabb8785ce77df2bd38aa2367ff3beff8ee66d11dcddbc9f34381e77
7
- data.tar.gz: 2f137a74a78104609ecfa801e4062d8797894ea44f237aa70fcb705d01459897f7bd76e12a45ea99e59ca83fab47abd90788b92a6b69e6573af94c6a28cb622a
6
+ metadata.gz: 8b7c58e6eb57eaef08542fb98f1d0c8c8729e415a0d2dee8a9ad49720fdbd64944855690b780a733fa1456cf7c698dc2e49b9d81194ab533108285c5bf32eb12
7
+ data.tar.gz: cbb331384f44f44b971200ab732e4459666d6eafa5fd93fe29b4f9bdcbf1ad7b700f518c276d60bd80725d84a0ddb359c40da134aa518447f50b4b21612c60d3
data/.travis.yml CHANGED
@@ -1,6 +1,6 @@
1
+ before_install:
2
+ - gem install bundler
1
3
  rvm:
2
- - 2
3
- - 2.1.0
4
- - 2.0.0
5
- - 1.9.3
6
- - jruby
4
+ - 2.3.0
5
+ - 2.2
6
+ - jruby-9.0.0.0
data/README.md CHANGED
@@ -57,6 +57,7 @@ Any of the defaults can be over-ridden in `config/deploy.rb`:
57
57
  set :slack_username, 'Deploybot'
58
58
  set :slack_emoji, ':trollface:'
59
59
  set :slack_user, ENV['GIT_AUTHOR_NAME']
60
+ set :slack_fields, ['status', 'stage', 'branch', 'revision', 'hosts']
60
61
  set :slack_hosts, -> { release_roles(:all).map(&:hostname).join("\n") }
61
62
  set :slack_text, -> {
62
63
  elapsed = Integer(fetch(:time_finished) - fetch(:time_started))
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'capistrano-slackify'
7
- spec.version = '2.6.1'
7
+ spec.version = '2.7.0'
8
8
  spec.authors = ['seenmyfate']
9
9
  spec.email = ['seenmyfate@gmail.com']
10
10
  spec.summary = %q{Publish deployment notifications to Slack via the incoming webhooks integration}
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.add_runtime_dependency 'capistrano', '>= 3.2.0'
21
21
  spec.add_runtime_dependency 'multi_json'
22
22
 
23
- spec.add_development_dependency 'bundler', '~> 1.5'
23
+ spec.add_development_dependency 'bundler', '~> 1'
24
24
  spec.add_development_dependency 'rake'
25
25
  spec.add_development_dependency 'rspec'
26
26
  end
@@ -58,6 +58,7 @@ namespace :load do
58
58
  set :slack_emoji, ':ghost:'
59
59
  set :slack_parse, 'default'
60
60
  set :slack_user, -> { local_user.strip }
61
+ set :slack_fields, ['status', 'stage', 'branch', 'revision', 'hosts']
61
62
  set :slack_hosts, -> { release_roles(:all).map(&:hostname).join("\n") }
62
63
  set :slack_url, -> { fail ':slack_url is not set' }
63
64
  set :slack_text, lambda {
data/lib/slackify.rb CHANGED
@@ -17,6 +17,40 @@ module Slackify
17
17
  end
18
18
 
19
19
  def payload
20
+ fields_map = {
21
+ 'status' => {
22
+ title: 'Status',
23
+ value: @status,
24
+ short: true
25
+ },
26
+ 'stage' => {
27
+ title: 'Stage',
28
+ value: fetch(:stage),
29
+ short: true
30
+ },
31
+ 'branch' => {
32
+ title: 'Branch',
33
+ value: fetch(:branch),
34
+ short: true
35
+ },
36
+ 'revision' => {
37
+ title: 'Revision',
38
+ value: fetch(:current_revision),
39
+ short: true
40
+ },
41
+ 'hosts' => {
42
+ title: 'Hosts',
43
+ value: fetch(:slack_hosts),
44
+ short: true
45
+ }
46
+ }
47
+
48
+ fields = []
49
+
50
+ fetch(:slack_fields).each { |field|
51
+ fields.push(fields_map[field])
52
+ }
53
+
20
54
  MultiJson.dump(
21
55
  {
22
56
  channel: fetch(:slack_channel),
@@ -28,33 +62,7 @@ module Slackify
28
62
  fallback: text,
29
63
  color: color,
30
64
  text: text,
31
- fields: [
32
- {
33
- title: 'Status',
34
- value: @status,
35
- short: true
36
- },
37
- {
38
- title: 'Stage',
39
- value: fetch(:stage),
40
- short: true
41
- },
42
- {
43
- title: 'Branch',
44
- value: fetch(:branch),
45
- short: true
46
- },
47
- {
48
- title: 'Revision',
49
- value: fetch(:current_revision),
50
- short: true
51
- },
52
- {
53
- title: 'Hosts',
54
- value: fetch(:slack_hosts),
55
- short: true
56
- },
57
- ]
65
+ fields: fields,
58
66
  }
59
67
  ]
60
68
  }
@@ -10,6 +10,7 @@ module Slackify
10
10
  slack_emoji: ':ghost:',
11
11
  slack_parse: 'default',
12
12
  slack_user: 'You',
13
+ slack_fields: ['status', 'stage', 'branch', 'revision', 'hosts'],
13
14
  slack_hosts: "192.168.10.1\r192.168.10.2",
14
15
  slack_text: ':boom:',
15
16
  slack_deploy_finished_color: 'good',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-slackify
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - seenmyfate
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-07 00:00:00.000000000 Z
11
+ date: 2016-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.5'
47
+ version: '1'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.5'
54
+ version: '1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  version: '0'
122
122
  requirements: []
123
123
  rubyforge_project:
124
- rubygems_version: 2.6.1
124
+ rubygems_version: 2.5.1
125
125
  signing_key:
126
126
  specification_version: 4
127
127
  summary: Publish deployment notifications to Slack via the incoming webhooks integration