Skip to content

Commit af9abdb

Browse files
committed
miscweb: Add support for notifier
Ref #10
1 parent 4e2f79b commit af9abdb

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

hieradata/environments/production/roles/miscweb.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ profile::certbot::certificates:
66
- podcast.jquery.com
77
- demos.jquerymobile.com
88
- themeroller.jquerymobile.com
9+
profile::notifier::tls_key_name: miscweb
910
profile::miscweb::default_certificate: miscweb
1011

1112
profile::miscweb::sites:
@@ -19,6 +20,7 @@ profile::miscweb::sites:
1920
name: jquery/podcast.jquery.com
2021
branch: main
2122
webroot: /build_production
23+
notifier: true
2224
extra_config: |
2325
# Compatibility with http://feeds.feedburner.com/jQueryPodcastShowNotes
2426
rewrite ^/feed/?$ /feed/jQueryPodcastShowNotes.xml permanent;

modules/profile/manifests/miscweb.pp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,18 @@
4949
path => "/srv/www/${fqdn}",
5050
remote => "https://github.com/${site['repository']['name']}",
5151
branch => $site['repository']['branch'],
52-
owner => 'root',
53-
group => 'root',
52+
owner => 'www-data',
53+
group => 'www-data',
54+
}
55+
56+
if $site['notifier'] {
57+
notifier::git_update { $fqdn:
58+
github_repository => $site['repository']['name'],
59+
listen_for => [{ branch => $site['repository']['branch'] }],
60+
local_path => "/srv/www/${fqdn}",
61+
local_user => 'www-data',
62+
require => Git::Clone[$fqdn],
63+
}
5464
}
5565

5666
nginx::site { $fqdn:

modules/profile/types/miscweb/site.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
}],
66
webroot => Optional[String[1]],
77
extra_config => Optional[String[1]],
8+
notifier => Optional[Boolean],
89
allow_php => Optional[Boolean],
910
php_env => Optional[Hash[String[1], String]],
1011
certificate => Optional[String[1]],

modules/role/manifests/miscweb.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
class role::miscweb {
33
include profile::base
44
include profile::certbot
5+
include profile::notifier
56

67
include profile::miscweb
78
}

0 commit comments

Comments
 (0)