mina-slack 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -1
- data/lib/mina/slack/tasks/mina-slack.rake +8 -2
- data/lib/mina/slack/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -26,7 +26,10 @@ In `config/deploy.rb`
|
|
26
26
|
require 'mina/slack/tasks'
|
27
27
|
|
28
28
|
# Set your WebHooks URL
|
29
|
-
set :slack_hook_url, 'https://
|
29
|
+
set :slack_hook_url, 'https://my.slack.com/services/hooks/incoming-webhook?token=token'
|
30
|
+
# Set deployment env
|
31
|
+
# default is value of settings.rails_env
|
32
|
+
set :slack_env, 'production'
|
30
33
|
|
31
34
|
# Invoke slack task in your deploy task
|
32
35
|
task :deploy do
|
@@ -37,6 +40,8 @@ task :deploy do
|
|
37
40
|
end
|
38
41
|
```
|
39
42
|
|
43
|
+
Notify text is `Finished deploy production` if you configure like above.
|
44
|
+
|
40
45
|
## Contributing
|
41
46
|
|
42
47
|
1. Fork it
|
@@ -2,7 +2,8 @@ require 'rest_client'
|
|
2
2
|
require 'json'
|
3
3
|
|
4
4
|
set_default :slack_hook_url, ''
|
5
|
-
set_default :
|
5
|
+
set_default :slack_payload_text, "Finished deploy"
|
6
|
+
set_default :slack_env, ->{ rails_env }
|
6
7
|
|
7
8
|
namespace :slack do
|
8
9
|
task :finish do
|
@@ -11,7 +12,12 @@ namespace :slack do
|
|
11
12
|
exit
|
12
13
|
end
|
13
14
|
|
14
|
-
|
15
|
+
if slack_payload_text.empty?
|
16
|
+
error "Please `set :slack_payload_text`."
|
17
|
+
exit
|
18
|
+
end
|
19
|
+
|
20
|
+
slack_payload = {text: "#{slack_payload_text} #{slack_env}"}
|
15
21
|
RestClient.post slack_hook_url, payload: slack_payload.to_json
|
16
22
|
end
|
17
23
|
end
|
data/lib/mina/slack/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mina-slack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|