Merge branch 'jenkins-build-34' into 'master'
Auto-merge for build 34 See merge request puppet/puppet_cd!30
This commit is contained in:
@@ -1502,6 +1502,24 @@
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>whether to manage the puppet user</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>pt_webhook_secret</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>String</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>''</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>the secret for the webhook</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
@@ -1517,7 +1535,6 @@
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
88
|
||||
89
|
||||
90
|
||||
91
|
||||
@@ -1678,10 +1695,12 @@
|
||||
246
|
||||
247
|
||||
248
|
||||
249</pre>
|
||||
249
|
||||
250
|
||||
251</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 88</span>
|
||||
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 89</span>
|
||||
|
||||
class puppet_cd::params (
|
||||
|
||||
@@ -1773,6 +1792,7 @@ class puppet_cd::params (
|
||||
String $pt_r10k_remote = 'git@gitlab.example.net/repo.git',
|
||||
Boolean $pt_r10k_prefix = false,
|
||||
String $pt_r10k_basedir = '/etc/puppetlabs/code/environments',
|
||||
String $pt_webhook_secret = '',
|
||||
|
||||
) {
|
||||
# facts
|
||||
|
||||
@@ -163,7 +163,8 @@
|
||||
65
|
||||
66
|
||||
67
|
||||
68</pre>
|
||||
68
|
||||
69</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'manifests/r10k/webhook.pp', line 6</span>
|
||||
@@ -207,6 +208,7 @@ class puppet_cd::r10k::webhook (
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
content => template($pt_r10k_hook_config_erb),
|
||||
notify => Service['webhook'],
|
||||
}
|
||||
|
||||
# create service config
|
||||
@@ -219,15 +221,15 @@ class puppet_cd::r10k::webhook (
|
||||
seltype => systemd_unit_file_t,
|
||||
seluser => system_u,
|
||||
content => template($pt_r10k_hook_service_erb),
|
||||
notify => Service['webhook'],
|
||||
}
|
||||
|
||||
# manage service
|
||||
service { 'r10k-webhook':
|
||||
service { 'webhook':
|
||||
ensure => 'running',
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
enable => true,
|
||||
subscribe => File[$pt_r10k_hook_service_file],
|
||||
}
|
||||
}
|
||||
}</pre>
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
# @param [String] pt_r10k_basedir the base directory for r10k.yaml
|
||||
# @param [String] pt_r10k_webhook_pkg the packages for the r10k webhook
|
||||
# @param [Boolean] pt_manage_user whether to manage the puppet user
|
||||
# @param [String] pt_webhook_secret the secret for the webhook
|
||||
###############################################################################
|
||||
class puppet_cd::params (
|
||||
|
||||
@@ -175,6 +176,7 @@ class puppet_cd::params (
|
||||
String $pt_r10k_remote = 'git@gitlab.example.net/repo.git',
|
||||
Boolean $pt_r10k_prefix = false,
|
||||
String $pt_r10k_basedir = '/etc/puppetlabs/code/environments',
|
||||
String $pt_webhook_secret = '',
|
||||
|
||||
) {
|
||||
# facts
|
||||
|
||||
@@ -42,6 +42,7 @@ class puppet_cd::r10k::webhook (
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
content => template($pt_r10k_hook_config_erb),
|
||||
notify => Service['webhook'],
|
||||
}
|
||||
|
||||
# create service config
|
||||
@@ -54,15 +55,15 @@ class puppet_cd::r10k::webhook (
|
||||
seltype => systemd_unit_file_t,
|
||||
seluser => system_u,
|
||||
content => template($pt_r10k_hook_service_erb),
|
||||
notify => Service['webhook'],
|
||||
}
|
||||
|
||||
# manage service
|
||||
service { 'r10k-webhook':
|
||||
service { 'webhook':
|
||||
ensure => 'running',
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
enable => true,
|
||||
subscribe => File[$pt_r10k_hook_service_file],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"trigger-rule": {
|
||||
"match": {
|
||||
"type": "payload-hash-sha1",
|
||||
"secret": "your_webhook_secret"
|
||||
"secret": "<%= @pt_webhook_secret %>"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"host": "<%= @pt_pm_fqdn %>",
|
||||
"port": "8088",
|
||||
"flush_env_cache": false,
|
||||
"branch_to_env_map": {
|
||||
"master": "production",
|
||||
"^env_(.*)$": "\g<1>"
|
||||
},
|
||||
"allowed_branches": "^(env_[\w]+|master)$"
|
||||
}
|
||||
Reference in New Issue
Block a user