Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: modules/adblockplus/manifests/sitescripts/repository.pp

Issue 29632558: #5944 - Introduce Puppet namespace adblockplus::sitescripts (Closed)
Patch Set: Created Dec. 7, 2017, 12:06 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « modules/adblockplus/manifests/sitescripts.pp ('k') | modules/sitescripts/manifests/init.pp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 define adblockplus::sitescripts::repository (
2 $location = "/opt/$name",
3 $source = "https://hg.adblockplus.org/$name",
4 ) {
5
6 ensure_packages([
7 'python',
8 'python-flup',
9 ])
10
11 $ensure_dependencies_command = shellquote([
12 'python', '--', "$location/ensure_dependencies.py", '-q'
13 ])
14
15 $fetch_command = join([
16 shellquote(['hg', 'clone', $source, $location]),
17 $ensure_dependencies_command,
18 ], ' && ')
19
20 exec { "fetch_$name":
21 command => shellquote(['hg', 'clone', $source, $location]),
22 creates => $location,
23 path => ['/usr/bin/', '/bin/'],
24 require => Package['mercurial'],
25 }
26
27 Exec["fetch_$name"] <- Package['mercurial']
28 Exec["fetch_$name"] <- Package['python']
29
30 $update_command = join([
31 shellquote(['hg', 'pull', '-q', '-u', '-R', $location]),
32 $ensure_dependencies_command,
33 ], ' && ')
34
35 cron {"update_$name":
36 ensure => 'present',
37 command => $update_command,
38 environment => hiera('cron::environment', []),
39 user => 'root',
40 minute => [15],
41 }
42
43 Cron["update_$name"] <- Exec["fetch_$name"]
44 }
OLDNEW
« no previous file with comments | « modules/adblockplus/manifests/sitescripts.pp ('k') | modules/sitescripts/manifests/init.pp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld