summaryrefslogtreecommitdiff
path: root/sitemodules/profiles/templates/puppet_server/webhook.conf.epp
blob: 6db1062b17564f0f6cc711dc0e212ea559e6c6be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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"
            }
          }
        }
      ]
    }
  }
]