puppet_webhook 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1766c8c40fdad1e020f0f749e7cad83fc4dcd60cd1c20fd20fad1d14cde5b350
4
- data.tar.gz: 57dc8f86203799218849a0baaddc6006535959345ccbad10d8863a4a08d1d476
3
+ metadata.gz: 7285f0d9e15b365e5b9e4b715a419182fc78e266f104762da4be350f45c05ffc
4
+ data.tar.gz: 619d6b615710aeb263f36f0d79162dd7036d18739ca5d5aa2dbe150f195f06a3
5
5
  SHA512:
6
- metadata.gz: 9ac05a999b6233e9fc4ab464e3d3f25b582f119efae8ff60bd069ca3582e4c17dd0f7e773088cafcac5fc61fc84113fdf6a28345d6ed1b8654e686368790d638
7
- data.tar.gz: 8a19dfe7d9b3264b7432bf208c4da1c0c5745c39a540744177336ca2317c0c44a31da85df35b70823a24fc28677339d06458cda64fcb4663008950e0d988e9d6
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
- Whether or not to use Slack Notifications.
196
- * Valid options: [ `true`, `false` ]
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
- if Open3.respond_to?('capture3')
51
- stdout, stderr, exit_status = Open3.capture3(command)
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: '#general',
91
- username: 'puppet_webhook',
92
- icon_emoji: ':ocean:',
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
 
@@ -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
@@ -20,7 +20,7 @@ module Sinatra
20
20
 
21
21
  module_name = sanitize_input(module_name)
22
22
  LOGGER.info("Deploying module #{module_name}")
23
- deploy_module(module_name)
23
+ Process.detach(fork { deploy_module(module_name) })
24
24
  end
25
25
  end
26
26
  end
@@ -61,7 +61,7 @@ module Sinatra
61
61
  return 200
62
62
  else
63
63
  LOGGER.info("Deploying environment #{env}")
64
- deploy(env, deleted)
64
+ Process.detach(fork { deploy(env, deleted) })
65
65
  end
66
66
  end
67
67
  end
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.2.0
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-06 00:00:00.000000000 Z
11
+ date: 2018-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json