slackistrano 3.0.1 → 3.1.0.beta
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 +4 -4
- data/README.md +132 -135
- data/images/custom_messaging.jpg +0 -0
- data/images/slackistrano.png +0 -0
- data/lib/slackistrano.rb +0 -3
- data/lib/slackistrano/capistrano.rb +83 -124
- data/lib/slackistrano/messaging/base.rb +73 -0
- data/lib/slackistrano/messaging/default.rb +31 -0
- data/lib/slackistrano/messaging/deprecated.rb +75 -0
- data/lib/slackistrano/messaging/helpers.rb +44 -0
- data/lib/slackistrano/tasks/slack.rake +4 -67
- data/lib/slackistrano/version.rb +1 -1
- data/slackistrano.gemspec +0 -1
- data/spec/dry_run_spec.rb +5 -5
- data/spec/{tasks_spec.rb → messaging/deprecated_spec.rb} +17 -20
- data/spec/messaging/helpers_spec.rb +36 -0
- data/spec/nil_payload_spec.rb +23 -0
- data/spec/posting_to_multiple_channels_spec.rb +5 -5
- data/spec/spec_helper.rb +4 -0
- data/spec/task_hooks_spec.rb +3 -3
- metadata +29 -34
- data/examples/fomatting_with_fields.png +0 -0
- data/slackistrano.png +0 -0
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Slackistrano::Messaging::Default do
|
4
|
+
|
5
|
+
describe '#branch' do
|
6
|
+
it "delegates to fetch" do
|
7
|
+
expect(subject).to receive(:fetch).with(:branch)
|
8
|
+
subject.branch
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
describe '#application' do
|
13
|
+
it "delegates to fetch" do
|
14
|
+
expect(subject).to receive(:fetch).with(:application)
|
15
|
+
subject.application
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe '#stage' do
|
20
|
+
it "delegates to fetch" do
|
21
|
+
expect(subject).to receive(:fetch).with(:stage, anything)
|
22
|
+
subject.stage
|
23
|
+
end
|
24
|
+
|
25
|
+
it "has a default" do
|
26
|
+
expect(subject.stage('default')).to eq 'default'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '#elapsed_time' do
|
31
|
+
it "returns a time like string" do
|
32
|
+
expect(subject.elapsed_time).to match /\A((\d+-)?\d+:)?\d\d:\d\d\Z/
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class NilPayloadMessaging < Slackistrano::Messaging::Default
|
4
|
+
def payload_for_updating
|
5
|
+
nil
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
describe Slackistrano do
|
10
|
+
before(:all) do
|
11
|
+
set :slackistrano, { klass: NilPayloadMessaging }
|
12
|
+
end
|
13
|
+
|
14
|
+
it "does not post on updating" do
|
15
|
+
expect_any_instance_of(Slackistrano::Capistrano).not_to receive(:post)
|
16
|
+
Rake::Task["slack:deploy:updating"].execute
|
17
|
+
end
|
18
|
+
|
19
|
+
it "posts on updated" do
|
20
|
+
expect_any_instance_of(Slackistrano::Capistrano).to receive(:post).and_return(true)
|
21
|
+
Rake::Task["slack:deploy:updated"].execute
|
22
|
+
end
|
23
|
+
end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Slackistrano do
|
4
|
-
before(:
|
5
|
-
|
4
|
+
before(:all) do
|
5
|
+
set :slackistrano, {
|
6
|
+
channel: %w[one two]
|
7
|
+
}
|
6
8
|
end
|
7
9
|
|
8
10
|
context "when :slack_channel is an array" do
|
9
11
|
%w[updating reverting updated reverted failed].each do |stage|
|
10
12
|
it "posts to slack on slack:deploy:#{stage} in every channel" do
|
11
|
-
|
12
|
-
set "slack_run_#{stage}".to_sym, ->{ true }
|
13
|
-
expect_any_instance_of(Slackistrano::Capistrano).to receive(:post_to_slack).twice.and_return(double(code: '200'))
|
13
|
+
expect_any_instance_of(Slackistrano::Capistrano).to receive(:post).twice
|
14
14
|
Rake::Task["slack:deploy:#{stage}"].execute
|
15
15
|
end
|
16
16
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -6,6 +6,7 @@ load 'capistrano_deploy_stubs.rake'
|
|
6
6
|
require 'slackistrano'
|
7
7
|
require 'slackistrano/capistrano'
|
8
8
|
require 'rspec'
|
9
|
+
require 'pry'
|
9
10
|
|
10
11
|
# Requires supporting files with custom matchers and macros, etc,
|
11
12
|
# in ./support/ and its subdirectories.
|
@@ -17,3 +18,6 @@ RSpec.configure do |config|
|
|
17
18
|
config.run_all_when_everything_filtered = true
|
18
19
|
config.fail_fast = 1
|
19
20
|
end
|
21
|
+
|
22
|
+
# Silence rake's '** Execute…' output
|
23
|
+
Rake.application.options.trace = false
|
data/spec/task_hooks_spec.rb
CHANGED
@@ -1,9 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Slackistrano do
|
4
|
-
before(:each) do
|
5
|
-
Rake::Task['load:defaults'].execute
|
6
|
-
end
|
7
4
|
|
8
5
|
describe "before/after hooks" do
|
9
6
|
|
@@ -30,6 +27,9 @@ describe Slackistrano do
|
|
30
27
|
Rake::Task['deploy:failed'].execute
|
31
28
|
end
|
32
29
|
|
30
|
+
it "invokes all slack:deploy tasks before slack:deploy:test" do
|
31
|
+
expect(Rake::Task['slack:deploy:test'].prerequisites).to match %w[updating updated reverting reverted failed]
|
32
|
+
end
|
33
33
|
end
|
34
34
|
|
35
35
|
end
|
metadata
CHANGED
@@ -1,83 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slackistrano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.1.0.beta
|
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-
|
11
|
+
date: 2016-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
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
26
|
version: 3.5.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: json
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rake
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
|
-
- -
|
31
|
+
- - '>='
|
46
32
|
- !ruby/object:Gem::Version
|
47
33
|
version: '0'
|
48
34
|
type: :development
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
|
-
- -
|
38
|
+
- - '>='
|
53
39
|
- !ruby/object:Gem::Version
|
54
40
|
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: rspec
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
|
-
- -
|
45
|
+
- - '>='
|
60
46
|
- !ruby/object:Gem::Version
|
61
47
|
version: '0'
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- -
|
52
|
+
- - '>='
|
67
53
|
- !ruby/object:Gem::Version
|
68
54
|
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: pry
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
|
-
- -
|
59
|
+
- - '>='
|
74
60
|
- !ruby/object:Gem::Version
|
75
61
|
version: '0'
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
|
-
- -
|
66
|
+
- - '>='
|
81
67
|
- !ruby/object:Gem::Version
|
82
68
|
version: '0'
|
83
69
|
description: Send notifications to Slack about Capistrano deployments.
|
@@ -87,26 +73,32 @@ executables: []
|
|
87
73
|
extensions: []
|
88
74
|
extra_rdoc_files: []
|
89
75
|
files:
|
90
|
-
-
|
91
|
-
-
|
76
|
+
- .gitignore
|
77
|
+
- .travis.yml
|
92
78
|
- CHANGELOG.md
|
93
79
|
- Gemfile
|
94
80
|
- LICENSE.txt
|
95
81
|
- README.md
|
96
82
|
- Rakefile
|
97
|
-
-
|
83
|
+
- images/custom_messaging.jpg
|
84
|
+
- images/slackistrano.png
|
98
85
|
- lib/slackistrano.rb
|
99
86
|
- lib/slackistrano/capistrano.rb
|
87
|
+
- lib/slackistrano/messaging/base.rb
|
88
|
+
- lib/slackistrano/messaging/default.rb
|
89
|
+
- lib/slackistrano/messaging/deprecated.rb
|
90
|
+
- lib/slackistrano/messaging/helpers.rb
|
100
91
|
- lib/slackistrano/tasks/slack.rake
|
101
92
|
- lib/slackistrano/version.rb
|
102
93
|
- slackistrano.gemspec
|
103
|
-
- slackistrano.png
|
104
94
|
- spec/capistrano_deploy_stubs.rake
|
105
95
|
- spec/dry_run_spec.rb
|
96
|
+
- spec/messaging/deprecated_spec.rb
|
97
|
+
- spec/messaging/helpers_spec.rb
|
98
|
+
- spec/nil_payload_spec.rb
|
106
99
|
- spec/posting_to_multiple_channels_spec.rb
|
107
100
|
- spec/spec_helper.rb
|
108
101
|
- spec/task_hooks_spec.rb
|
109
|
-
- spec/tasks_spec.rb
|
110
102
|
homepage: https://github.com/phallstrom/slackistrano
|
111
103
|
licenses:
|
112
104
|
- MIT
|
@@ -121,24 +113,27 @@ require_paths:
|
|
121
113
|
- lib
|
122
114
|
required_ruby_version: !ruby/object:Gem::Requirement
|
123
115
|
requirements:
|
124
|
-
- -
|
116
|
+
- - '>='
|
125
117
|
- !ruby/object:Gem::Version
|
126
118
|
version: 2.0.0
|
127
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
120
|
requirements:
|
129
|
-
- -
|
121
|
+
- - '>'
|
130
122
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
123
|
+
version: 1.3.1
|
132
124
|
requirements: []
|
133
125
|
rubyforge_project:
|
134
|
-
rubygems_version: 2.
|
126
|
+
rubygems_version: 2.0.14.1
|
135
127
|
signing_key:
|
136
128
|
specification_version: 4
|
137
129
|
summary: Send notifications to Slack about Capistrano deployments.
|
138
130
|
test_files:
|
139
131
|
- spec/capistrano_deploy_stubs.rake
|
140
132
|
- spec/dry_run_spec.rb
|
133
|
+
- spec/messaging/deprecated_spec.rb
|
134
|
+
- spec/messaging/helpers_spec.rb
|
135
|
+
- spec/nil_payload_spec.rb
|
141
136
|
- spec/posting_to_multiple_channels_spec.rb
|
142
137
|
- spec/spec_helper.rb
|
143
138
|
- spec/task_hooks_spec.rb
|
144
|
-
|
139
|
+
has_rdoc:
|
Binary file
|
data/slackistrano.png
DELETED
Binary file
|