slackistrano 2.0.1 → 3.0.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: 851d5d5bb98527246ddb446956250f5670007aca
4
- data.tar.gz: bf3821250a52f2c3c5fcd7212a192e38878fb56b
3
+ metadata.gz: 59a1150f8f084d30eee0a6980e1c0da4dc1b1ed9
4
+ data.tar.gz: 9cd936ebeafd517be8bd517c8de4dbf0f29a2b0b
5
5
  SHA512:
6
- metadata.gz: 36d3edcd7e42fbcb65ca35e641922666ce9d3ee7b00acf3bcda56478041cb1d12fc46b8923a1fd4abfb992efd120daaa10aadb732638f3262188562068014734
7
- data.tar.gz: d8ebee206e6a4ab2ef7fa5f5304cfbe47c4d8d984fe59d4e847d502c3420e25510112ebab258a65b05f27277c99d6c6b444ba99cad92bf8318593afa283f505a
6
+ metadata.gz: 6d24aba67028a48026a16c83911093d6a10f44851fedb38cc6cac106b4af1027538f2c376b40904154ca6c226fb6e7abcb9bd25819d5e359fe6549157a51ed2a
7
+ data.tar.gz: ee872b49c00d621d5b40bd3122ef5921bd56305503886d696bebdd424f7e18f62d178469268e92ff4c94cfb34f7fa1b89093acd4524de69c8fbfa4d86d4aca48
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Slackistrano Change Log
2
2
 
3
+ 3.0.0
4
+ -----
5
+
6
+ - Require version 3.5.0 of Capistrano and utilize it's new dry-run functionality.
7
+
3
8
  2.0.1
4
9
  -----
5
10
 
data/README.md CHANGED
@@ -146,24 +146,24 @@ set :slack_msg_updated, nil
146
146
  set :slack_fallback_updated, "#{fetch(:slack_deploy_user)} deployed #{fetch(:application)} on #{fetch(:stage)}"
147
147
  set :slack_fields_updated, [
148
148
  {
149
- "title": "Project",
150
- "value": "<https://github.com/XXXXX/#{fetch(:application)}|#{fetch(:application)}>",
151
- "short": true
149
+ title: "Project",
150
+ value: "<https://github.com/XXXXX/#{fetch(:application)}|#{fetch(:application)}>",
151
+ short: true
152
152
  },
153
153
  {
154
- "title": "Environment",
155
- "value": fetch(:stage),
156
- "short": true
154
+ title: "Environment",
155
+ value: fetch(:stage),
156
+ short: true
157
157
  },
158
158
  {
159
- "title": "Deployer",
160
- "value": fetch(:slack_deploy_user),
161
- "short": true
159
+ title: "Deployer",
160
+ value: fetch(:slack_deploy_user),
161
+ short: true
162
162
  },
163
163
  {
164
- "title": "Revision",
165
- "value": "<https://github.com/XXXXX/#{fetch(:application)}/commit/#{fetch(:slack_revision)}|#{fetch(:slack_revision)[0..6]}>",
166
- "short": true
164
+ title: "Revision",
165
+ value: "<https://github.com/XXXXX/#{fetch(:application)}/commit/#{fetch(:slack_revision)}|#{fetch(:slack_revision)[0..6]}>",
166
+ short: true
167
167
  }
168
168
  ]
169
169
  ```
@@ -67,10 +67,13 @@ module Slackistrano
67
67
  channels.each do |channel|
68
68
  payload[:channel] = channel
69
69
 
70
- # This is a nasty hack, but until Capistrano provides an official way to determine if
71
- # --dry-run was passed this is the only option.
72
- # See https://github.com/capistrano/capistrano/issues/1462
73
- if ::Capistrano::Configuration.env.send(:config)[:sshkit_backend] == SSHKit::Backend::Printer
70
+ dry_run = if ::Capistrano::Configuration.respond_to?(:dry_run?)
71
+ ::Capistrano::Configuration.dry_run?
72
+ else
73
+ ::Capistrano::Configuration.env.send(:config)[:sshkit_backend] == SSHKit::Backend::Printer
74
+ end
75
+
76
+ if dry_run
74
77
  backend.info("[slackistrano] Slackistrano Dry Run:")
75
78
  backend.info("[slackistrano] Team: #{team}")
76
79
  backend.info("[slackistrano] Webhook: #{webhook}")
@@ -1,3 +1,3 @@
1
1
  module Slackistrano
2
- VERSION = '2.0.1'
2
+ VERSION = '3.0.0'
3
3
  end
data/slackistrano.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |gem|
20
20
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
21
21
  gem.require_paths = ["lib"]
22
22
 
23
- gem.add_dependency 'capistrano', '>= 3.0.1'
23
+ gem.add_dependency 'capistrano', '>= 3.5.0'
24
24
  gem.add_dependency 'json'
25
25
  gem.add_development_dependency 'rake'
26
26
  gem.add_development_dependency 'rspec'
data/spec/dry_run_spec.rb CHANGED
@@ -8,7 +8,7 @@ describe Slackistrano do
8
8
  %w[updating reverting updated reverted failed].each do |stage|
9
9
  it "does not post to slack on slack:deploy:#{stage}" do
10
10
  set "slack_run_#{stage}".to_sym, ->{ true }
11
- expect(Capistrano::Configuration.env.send(:config)).to receive(:[]).with(:sshkit_backend).and_return(SSHKit::Backend::Printer)
11
+ expect(Capistrano::Configuration).to receive(:dry_run?).and_return(true)
12
12
  expect(Slackistrano).not_to receive(:post)
13
13
  Rake::Task["slack:deploy:#{stage}"].execute
14
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slackistrano
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Hallstrom
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-20 00:00:00.000000000 Z
11
+ date: 2016-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.1
19
+ version: 3.5.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 3.0.1
26
+ version: 3.5.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  requirements: []
132
132
  rubyforge_project:
133
- rubygems_version: 2.4.6
133
+ rubygems_version: 2.5.1
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: Send notifications to Slack about Capistrano deployments.