slackistrano 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +8 -3
- data/lib/slackistrano/tasks/slack.rake +35 -27
- data/lib/slackistrano/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 294088d3eaca90fd7c1f36f335c137295e1ba698
|
4
|
+
data.tar.gz: 3b5070537b056e5034c697fe5ee2ab9bceb272d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acc93217d6ae0796a45fb693c91daf18f019d63f1487fc26c5d689e4cd3a81e344fe42161648c16a5f3a73eb2caa20bf77164e1aae925d5531586b4a6f306845
|
7
|
+
data.tar.gz: 329a8c413a6886a015d38912b972927ca0084e912b3c3790a9168a10cb07012393eb9ca8e869252d8b95dcdd9a3a7b3e5e072743731b0673bd03e60b07a4fd19
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -40,9 +40,14 @@ Set your team and token in your application's config/deploy.rb:
|
|
40
40
|
|
41
41
|
Optionally, override the other slack settings:
|
42
42
|
|
43
|
-
set :slack_icon_url, ->{
|
44
|
-
set :slack_channel, ->{
|
45
|
-
set :slack_username, ->{
|
43
|
+
set :slack_icon_url, ->{ 'http://gravatar.com/avatar/885e1c523b7975c4003de162d8ee8fee?r=g&s=40' }
|
44
|
+
set :slack_channel, ->{ '#general' }
|
45
|
+
set :slack_username, ->{ 'Slackistrano' }
|
46
|
+
set :slack_run_starting, ->{ true }
|
47
|
+
set :slack_run_finished, ->{ true }
|
48
|
+
|
49
|
+
Note: You may wish to disable one of the notifications if another service (ex:
|
50
|
+
Honeybadger) also displays a deploy notification.
|
46
51
|
|
47
52
|
Test your setup by running:
|
48
53
|
|
@@ -1,34 +1,40 @@
|
|
1
|
+
|
1
2
|
namespace :slack do
|
2
3
|
namespace :deploy do
|
4
|
+
|
3
5
|
task :starting do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
6
|
+
if fetch(:slack_run_starting)
|
7
|
+
run_locally do
|
8
|
+
text = "#{ENV['USER'] || ENV['USERNAME']} has started deploying branch #{fetch :branch} of #{fetch :application} to #{fetch :rails_env, 'production'}."
|
9
|
+
Slackistrano.post(
|
10
|
+
team: fetch(:slack_team),
|
11
|
+
token: fetch(:slack_token),
|
12
|
+
payload: {
|
13
|
+
channel: fetch(:slack_channel),
|
14
|
+
username: fetch(:slack_username),
|
15
|
+
icon_url: fetch(:slack_icon_url),
|
16
|
+
text: text
|
17
|
+
}
|
18
|
+
)
|
19
|
+
end
|
16
20
|
end
|
17
21
|
end
|
18
22
|
|
19
23
|
task :finished do
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
24
|
+
if fetch(:slack_run_finished)
|
25
|
+
run_locally do
|
26
|
+
text = "#{ENV['USER'] || ENV['USERNAME']} has finished deploying branch #{fetch :branch} of #{fetch :application} to #{fetch :rails_env, 'production'}."
|
27
|
+
Slackistrano.post(
|
28
|
+
team: fetch(:slack_team),
|
29
|
+
token: fetch(:slack_token),
|
30
|
+
payload: {
|
31
|
+
channel: fetch(:slack_channel),
|
32
|
+
username: fetch(:slack_username),
|
33
|
+
icon_url: fetch(:slack_icon_url),
|
34
|
+
text: text
|
35
|
+
}
|
36
|
+
)
|
37
|
+
end
|
32
38
|
end
|
33
39
|
end
|
34
40
|
end
|
@@ -41,8 +47,10 @@ namespace :load do
|
|
41
47
|
task :defaults do
|
42
48
|
set :slack_team, ->{ nil } # If URL is 'team.slack.com', value is 'team'. Required.
|
43
49
|
set :slack_token, ->{ nil } # Token from Incoming WebHooks. Required.
|
44
|
-
set :slack_icon_url, ->{
|
45
|
-
set :slack_channel, ->{
|
46
|
-
set :slack_username, ->{
|
50
|
+
set :slack_icon_url, ->{ 'http://gravatar.com/avatar/885e1c523b7975c4003de162d8ee8fee?r=g&s=40' }
|
51
|
+
set :slack_channel, ->{ '#general' }
|
52
|
+
set :slack_username, ->{ 'Slackistrano' }
|
53
|
+
set :slack_run_starting, ->{ true } # Set to false to disable starting message.
|
54
|
+
set :slack_run_finished, ->{ true } # Set to false to disable finished message.
|
47
55
|
end
|
48
56
|
end
|
data/lib/slackistrano/version.rb
CHANGED
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: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philip Hallstrom
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|