summaryrefslogtreecommitdiff
path: root/sitemodules/profiles/templates/puppet_server/webhook.conf.epp
diff options
context:
space:
mode:
Diffstat (limited to 'sitemodules/profiles/templates/puppet_server/webhook.conf.epp')
-rw-r--r--sitemodules/profiles/templates/puppet_server/webhook.conf.epp40
1 files changed, 40 insertions, 0 deletions
diff --git a/sitemodules/profiles/templates/puppet_server/webhook.conf.epp b/sitemodules/profiles/templates/puppet_server/webhook.conf.epp
new file mode 100644
index 0000000..6db1062
--- /dev/null
+++ b/sitemodules/profiles/templates/puppet_server/webhook.conf.epp
@@ -0,0 +1,40 @@
+<%- | String $token = undef, Array[String] $branches = undef | -%>
+[
+ {
+ "id": "puppet-deploy",
+ "execute-command": "/usr/local/sbin/puppet-deploy",
+ "command-working-directory": "/etc/puppetlabs/code/environments",
+ "include-command-output-in-response": true,
+ "include-command-output-in-response-on-error": true,
+ "pass-arguments-to-command": [
+ {
+ "source": "payload",
+ "name": "ref"
+ }
+ ],
+ "trigger-rule": {
+ "and": [
+ {
+ "match": {
+ "type": "value",
+ "value": "<%= $token %>",
+ "parameter": {
+ "source": "header",
+ "name": "Authentication"
+ }
+ }
+ },
+ {
+ "match": {
+ "type": "regex",
+ "regex": "^refs/heads/(<%= $branches.join("|") %>)$",
+ "parameter": {
+ "source": "payload",
+ "name": "ref"
+ }
+ }
+ }
+ ]
+ }
+ }
+] \ No newline at end of file