puppet_webhook 1.2.0 → 1.3.0
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/CHANGELOG.md +8 -0
- data/README.md +17 -2
- data/lib/helpers/tasks.rb +5 -12
- data/lib/puppet_webhook.rb +3 -0
- data/lib/routes/module.rb +1 -1
- data/lib/routes/payload.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7285f0d9e15b365e5b9e4b715a419182fc78e266f104762da4be350f45c05ffc
|
4
|
+
data.tar.gz: 619d6b615710aeb263f36f0d79162dd7036d18739ca5d5aa2dbe150f195f06a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 761de6f49d6d89c87a8c90fd790e2886b6d0fd316d996749cf2cc13ae8605deddd3e360ffa00f27a7449171856ffccc1b03854a590572031c1974a63e615b01a
|
7
|
+
data.tar.gz: a4f40e21093d3eebe62a95fc167297d84dc9b027f442d1be2efbd80a0394f65cb22ba66bc67fdba44118315d8588b399e76de49cf0108c79995bf36fb4675963
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
Each new release typically also includes the latest modulesync defaults.
|
5
5
|
These should not affect the functionality of the module.
|
6
6
|
|
7
|
+
## [v1.3.0](https://github.com/voxpupuli/puppet_webhook/tree/v1.3.0) (2018-04-24)
|
8
|
+
[Full Changelog](https://github.com/voxpupuli/puppet_webhook/compare/v1.2.0...v1.3.0)
|
9
|
+
|
10
|
+
**Implemented enhancements:**
|
11
|
+
|
12
|
+
- Add additional Slack options. [\#50](https://github.com/voxpupuli/puppet_webhook/pull/50) ([dhollinger](https://github.com/dhollinger))
|
13
|
+
- Async routes [\#49](https://github.com/voxpupuli/puppet_webhook/pull/49) ([dhollinger](https://github.com/dhollinger))
|
14
|
+
|
7
15
|
## [v1.2.0](https://github.com/voxpupuli/puppet_webhook/tree/v1.2.0) (2018-04-06)
|
8
16
|
[Full Changelog](https://github.com/voxpupuli/puppet_webhook/compare/v1.1.0...v1.2.0)
|
9
17
|
|
data/README.md
CHANGED
@@ -192,10 +192,25 @@ MCollective Ruby discovery timeout. REQUIRES `use_mco_ruby` TO BE `true`.
|
|
192
192
|
|
193
193
|
##### slack_webhook
|
194
194
|
|
195
|
-
|
196
|
-
* Valid options: [ `
|
195
|
+
URL of your Slack Webhook receiver, if you wish not to use a Slack Webhook, then simply leave the option on `false`, otherwise use the full Wwebhook URL for your community as per https://api.slack.com/incoming-webhooks.
|
196
|
+
* Valid options: [ `https://hooks.slack.com/services/<generated_hash>`, `false` ]
|
197
197
|
* Default: `false`
|
198
198
|
|
199
|
+
##### slack_channel
|
200
|
+
|
201
|
+
Name of the Slack channel to post to. Ignored if `slack_webhook` is disabled.
|
202
|
+
Default: `#general`
|
203
|
+
|
204
|
+
##### slack_user
|
205
|
+
|
206
|
+
Name of the Slack user to post as. Ignored if `slack_webhook` is disabled.
|
207
|
+
Default: `puppet_webhook`
|
208
|
+
|
209
|
+
##### slack_emoji
|
210
|
+
|
211
|
+
Icon emoji for the Webhook to use when posting. Ignored if `slack_webhook` is disabled.
|
212
|
+
Default: `:ocean:`
|
213
|
+
|
199
214
|
##### slack_proxy_url
|
200
215
|
|
201
216
|
The proxy URL for Slack if used.
|
data/lib/helpers/tasks.rb
CHANGED
@@ -47,15 +47,8 @@ module Tasks # rubocop:disable Style/Documentation
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def run_command(command)
|
50
|
-
|
51
|
-
|
52
|
-
message = "triggered: #{command}\n#{stdout}\n#{stderr}"
|
53
|
-
else
|
54
|
-
message = "forked: #{command}"
|
55
|
-
Process.detach(fork { exec "#{command} &" })
|
56
|
-
exit_status = 0
|
57
|
-
end
|
58
|
-
raise "#{stdout}\n#{stderr}" if exit_status != 0
|
50
|
+
message = "forked: #{command}"
|
51
|
+
exec "#{command} &"
|
59
52
|
message
|
60
53
|
end
|
61
54
|
|
@@ -87,9 +80,9 @@ module Tasks # rubocop:disable Style/Documentation
|
|
87
80
|
end
|
88
81
|
|
89
82
|
notifier = Slack::Notifier.new settings.slack_webhook do
|
90
|
-
defaults channel:
|
91
|
-
username:
|
92
|
-
icon_emoji:
|
83
|
+
defaults channel: settings.slack_channel,
|
84
|
+
username: settings.slack_user,
|
85
|
+
icon_emoji: settings.slack_emoji,
|
93
86
|
http_options: http_options
|
94
87
|
end
|
95
88
|
|
data/lib/puppet_webhook.rb
CHANGED
@@ -38,6 +38,9 @@ class PuppetWebhook < Sinatra::Base # rubocop:disable Style/Documentation
|
|
38
38
|
set :use_mcollective, false unless settings.respond_to? :use_mcollective=
|
39
39
|
set :discovery_timeout, false unless settings.respond_to? :discovery_timeout=
|
40
40
|
set :slack_webhook, false unless settings.respond_to? :slack_webhook=
|
41
|
+
set :slack_channel, '#general' unless settings.respond_to? :slack_channel=
|
42
|
+
set :slack_user, 'puppet_webhook' unless settings.respond_to? :slack_user=
|
43
|
+
set :slack_emoji, ':ocean:' unless settings.respond_to? :slack_emoji=
|
41
44
|
set :slack_proxy_url, nil unless settings.respond_to? :slack_proxy_url=
|
42
45
|
set :default_branch, 'production' unless settings.respond_to? :default_branch=
|
43
46
|
set :ignore_environments, [] unless settings.respond_to? :ignore_environments=
|
data/lib/routes/module.rb
CHANGED
data/lib/routes/payload.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet_webhook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vox Pupuli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|