slackistrano 4.0.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +5 -0
- data/lib/slackistrano/messaging/base.rb +7 -1
- data/lib/slackistrano/messaging/default.rb +4 -0
- data/lib/slackistrano/messaging/null.rb +4 -0
- data/lib/slackistrano/tasks/slack.rake +7 -1
- data/lib/slackistrano/version.rb +1 -1
- data/spec/capistrano_deploy_stubs.rake +2 -0
- data/spec/disabling_posting_to_slack_spec.rb +1 -1
- data/spec/dry_run_spec.rb +1 -1
- data/spec/posting_to_multiple_channels_spec.rb +1 -1
- data/spec/task_hooks_spec.rb +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0686016bcf4e850937467636868dd9118d2fdbcefc69ce77eedaefa8b8aed649'
|
4
|
+
data.tar.gz: cfd0a46134a29d3dd2bf09751b96177d2bdd16322351f48b45f84c70ffc48786
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b04cf3360fcdfb7b1d02948bce6852a6fb18cf1816b91d1fc85082164958dfb6e7a477ebed6df123d1db03fc68d4871db273547295195806020a767743005942
|
7
|
+
data.tar.gz: 8f4e1f0faa9a6b303f1bcb0a256bc5fdeb26a4a6c5094c1a075b0d1ce10e779762348a15f9051b9eaa57a51f5ae24d420f19309130006feeb4524d7ee4a9a36e
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -22,12 +22,18 @@ module Slackistrano
|
|
22
22
|
@webhook = options.delete(:webhook)
|
23
23
|
end
|
24
24
|
|
25
|
-
def
|
25
|
+
def payload_for_starting
|
26
26
|
{
|
27
27
|
text: "#{deployer} has started deploying branch #{branch} of #{application} to #{stage}"
|
28
28
|
}
|
29
29
|
end
|
30
30
|
|
31
|
+
def payload_for_updating
|
32
|
+
{
|
33
|
+
text: "#{deployer} is deploying branch #{branch} of #{application} to #{stage}"
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
31
37
|
def payload_for_reverting
|
32
38
|
{
|
33
39
|
text: "#{deployer} has started rolling back branch #{branch} of #{application} to #{stage}"
|
@@ -1,6 +1,11 @@
|
|
1
1
|
namespace :slack do
|
2
2
|
namespace :deploy do
|
3
3
|
|
4
|
+
desc 'Notify about starting deploy'
|
5
|
+
task :starting do
|
6
|
+
Slackistrano::Capistrano.new(self).run(:starting)
|
7
|
+
end
|
8
|
+
|
4
9
|
desc 'Notify about updating deploy'
|
5
10
|
task :updating do
|
6
11
|
Slackistrano::Capistrano.new(self).run(:updating)
|
@@ -27,13 +32,14 @@ namespace :slack do
|
|
27
32
|
end
|
28
33
|
|
29
34
|
desc 'Test Slack integration'
|
30
|
-
task :test => %i[updating updated reverting reverted failed] do
|
35
|
+
task :test => %i[starting updating updated reverting reverted failed] do
|
31
36
|
# all tasks run as dependencies
|
32
37
|
end
|
33
38
|
|
34
39
|
end
|
35
40
|
end
|
36
41
|
|
42
|
+
before 'deploy:starting', 'slack:deploy:starting'
|
37
43
|
before 'deploy:updating', 'slack:deploy:updating'
|
38
44
|
before 'deploy:reverting', 'slack:deploy:reverting'
|
39
45
|
after 'deploy:finishing', 'slack:deploy:updated'
|
data/lib/slackistrano/version.rb
CHANGED
@@ -6,7 +6,7 @@ describe Slackistrano do
|
|
6
6
|
set :slackistrano, false
|
7
7
|
end
|
8
8
|
|
9
|
-
%w[updating reverting updated reverted failed].each do |stage|
|
9
|
+
%w[starting updating reverting updated reverted failed].each do |stage|
|
10
10
|
it "doesn't post on slack:deploy:#{stage}" do
|
11
11
|
expect_any_instance_of(Slackistrano::Capistrano).not_to receive(:post)
|
12
12
|
Rake::Task["slack:deploy:#{stage}"].execute
|
data/spec/dry_run_spec.rb
CHANGED
@@ -11,7 +11,7 @@ describe Slackistrano do
|
|
11
11
|
set :slackistrano, { klass: DryRunMessaging }
|
12
12
|
end
|
13
13
|
|
14
|
-
%w[updating reverting updated reverted failed].each do |stage|
|
14
|
+
%w[starting updating reverting updated reverted failed].each do |stage|
|
15
15
|
it "does not post to slack on slack:deploy:#{stage}" do
|
16
16
|
allow_any_instance_of(Slackistrano::Capistrano).to receive(:dry_run?).and_return(true)
|
17
17
|
expect_any_instance_of(Slackistrano::Capistrano).to receive(:post_dry_run)
|
@@ -8,7 +8,7 @@ describe Slackistrano do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
context "when :slack_channel is an array" do
|
11
|
-
%w[updating reverting updated reverted failed].each do |stage|
|
11
|
+
%w[starting updating reverting updated reverted failed].each do |stage|
|
12
12
|
it "posts to slack on slack:deploy:#{stage} in every channel" do
|
13
13
|
expect_any_instance_of(Slackistrano::Capistrano).to receive(:post).twice
|
14
14
|
Rake::Task["slack:deploy:#{stage}"].execute
|
data/spec/task_hooks_spec.rb
CHANGED
@@ -4,6 +4,10 @@ describe Slackistrano do
|
|
4
4
|
|
5
5
|
describe "before/after hooks" do
|
6
6
|
|
7
|
+
it "invokes slack:deploy:starting before deploy:starting" do
|
8
|
+
expect(Rake::Task['deploy:starting'].prerequisites).to include 'slack:deploy:starting'
|
9
|
+
end
|
10
|
+
|
7
11
|
it "invokes slack:deploy:updating before deploy:updating" do
|
8
12
|
expect(Rake::Task['deploy:updating'].prerequisites).to include 'slack:deploy:updating'
|
9
13
|
end
|
@@ -28,7 +32,7 @@ describe Slackistrano do
|
|
28
32
|
end
|
29
33
|
|
30
34
|
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]
|
35
|
+
expect(Rake::Task['slack:deploy:test'].prerequisites).to match %w[starting updating updated reverting reverted failed]
|
32
36
|
end
|
33
37
|
end
|
34
38
|
|