slackistrano 0.0.4 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd9f66b1c14873c85e1a6dc48062ea52bea137e6
4
- data.tar.gz: 2d16038edb00208dbca39fe136700cb2d44bdd60
3
+ metadata.gz: 294088d3eaca90fd7c1f36f335c137295e1ba698
4
+ data.tar.gz: 3b5070537b056e5034c697fe5ee2ab9bceb272d3
5
5
  SHA512:
6
- metadata.gz: a6d8f72d6d9cacbc87de172e9cf1260ce969650323cfa09e1b15d353de03fb29622dbafdddca3a940604f564016e4d3f7c3c9d00af6778c3db56a801f6b3f8a7
7
- data.tar.gz: 9ddc5183a852fdb69894e7dddd1babba4991ffa5c9a098d4c4efd21ee98a8ca3a3644d8b176466a6e800edaa1496f1cf40b7a29dbf3c788e5599c82fe39d0587
6
+ metadata.gz: acc93217d6ae0796a45fb693c91daf18f019d63f1487fc26c5d689e4cd3a81e344fe42161648c16a5f3a73eb2caa20bf77164e1aae925d5531586b4a6f306845
7
+ data.tar.gz: 329a8c413a6886a015d38912b972927ca0084e912b3c3790a9168a10cb07012393eb9ca8e869252d8b95dcdd9a3a7b3e5e072743731b0673bd03e60b07a4fd19
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  pkg
2
+ Gemfile.lock
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, ->{ "http://gravatar.com/avatar/885e1c523b7975c4003de162d8ee8fee?r=g&s=40" }
44
- set :slack_channel, ->{ "#general" }
45
- set :slack_username, ->{ "Slackistrano" }
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
- run_locally do
5
- text = "#{ENV['USER'] || ENV['USERNAME']} has started deploying branch #{fetch :branch} of #{fetch :application} to #{fetch :stage, 'unknown stage'}."
6
- Slackistrano.post(
7
- team: fetch(:slack_team),
8
- token: fetch(:slack_token),
9
- payload: {
10
- channel: fetch(:slack_channel),
11
- username: fetch(:slack_username),
12
- icon_url: fetch(:slack_icon_url),
13
- text: text
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
- run_locally do
21
- text = "#{ENV['USER'] || ENV['USERNAME']} has finished deploying branch #{fetch :branch} of #{fetch :application} to #{fetch :stage, 'unknown stage'}."
22
- Slackistrano.post(
23
- team: fetch(:slack_team),
24
- token: fetch(:slack_token),
25
- payload: {
26
- channel: fetch(:slack_channel),
27
- username: fetch(:slack_username),
28
- icon_url: fetch(:slack_icon_url),
29
- text: text
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, ->{ "http://gravatar.com/avatar/885e1c523b7975c4003de162d8ee8fee?r=g&s=40" }
45
- set :slack_channel, ->{ "#general" }
46
- set :slack_username, ->{ "Slackistrano" }
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
@@ -1,3 +1,3 @@
1
1
  module Slackistrano
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  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: 0.0.4
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-02-28 00:00:00.000000000 Z
11
+ date: 2014-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json