OLD | NEW |
1 class rietveld( | 1 class rietveld( |
2 $domain, | 2 $domain, |
3 $certificate, | 3 $certificate, |
4 $private_key, | 4 $private_key, |
5 $is_default = false, | 5 $is_default = false, |
6 $secret_key = hiera('rietveld::secret_key', ''), | 6 $secret_key = hiera('rietveld::secret_key', ''), |
7 $admins = hiera('rietveld::admins', []), | 7 $admins = hiera('rietveld::admins', []), |
8 $oauth2_client_id = hiera('rietveld::oauth2_client_id', ''), | 8 $oauth2_client_id = hiera('rietveld::oauth2_client_id', ''), |
9 $oauth2_client_secret = hiera('rietveld::oauth2_client_secret', ''), | 9 $oauth2_client_secret = hiera('rietveld::oauth2_client_secret', ''), |
10 ) { | 10 ) { |
11 | 11 |
12 include nginx | 12 include nginx |
13 $rietveld_home = '/opt/rietveld' | 13 $rietveld_home = '/opt/rietveld' |
| 14 $rietveld_branch = 'default' |
| 15 $rietveld_revision = '2259be9bd074' |
| 16 $rietveld_source = 'https://hg.adblockplus.org/rietveld' |
14 | 17 |
15 Exec { | 18 Exec { |
16 path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', | 19 path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', |
17 } | 20 } |
18 | 21 |
19 nginx::hostconfig {$domain: | 22 nginx::hostconfig {$domain: |
20 source => 'puppet:///modules/rietveld/site.conf', | 23 source => 'puppet:///modules/rietveld/site.conf', |
21 is_default => $is_default, | 24 is_default => $is_default, |
22 certificate => $certificate, | 25 certificate => $certificate, |
23 private_key => $private_key, | 26 private_key => $private_key, |
24 log => 'access_log_codereview' | 27 log => 'access_log_codereview' |
25 } | 28 } |
26 | 29 |
27 package {['wget', 'unzip', 'git', 'make', 'patch', 'subversion']: ensure => pr
esent} | 30 package {['wget', 'unzip', 'make', 'patch', 'subversion']: ensure => present} |
28 | 31 |
29 user {'rietveld': | 32 user {'rietveld': |
30 ensure => present, | 33 ensure => present, |
31 comment => 'User of the rietveld installation', | 34 comment => 'User of the rietveld installation', |
32 home => '/home/rietveld', | 35 home => '/home/rietveld', |
33 managehome => true | 36 managehome => true |
34 } | 37 } |
35 | 38 |
36 exec {'download_appengine': | 39 exec {'download_appengine': |
37 # TODO: We cannot rely on this URL to stay fixed | 40 # TODO: We cannot rely on this URL to stay fixed |
38 command => 'wget -O /home/rietveld/google_appengine.zip https://storage.goog
leapis.com/appengine-sdks/featured/google_appengine_1.9.21.zip', | 41 command => 'wget -O /home/rietveld/google_appengine.zip https://storage.goog
leapis.com/appengine-sdks/featured/google_appengine_1.9.21.zip', |
39 user => 'root', | 42 user => 'root', |
40 creates => '/home/rietveld/google_appengine.zip', | 43 creates => '/home/rietveld/google_appengine.zip', |
41 require => [User['rietveld'], Package['wget']], | 44 require => [User['rietveld'], Package['wget']], |
42 } | 45 } |
43 | 46 |
44 exec {'install_appengine': | 47 exec {'install_appengine': |
45 command => 'unzip /home/rietveld/google_appengine.zip -d /opt', | 48 command => 'unzip /home/rietveld/google_appengine.zip -d /opt', |
46 user => 'root', | 49 user => 'root', |
47 creates => '/opt/google_appengine', | 50 creates => '/opt/google_appengine', |
48 require => [Exec['download_appengine'], Package['unzip']], | 51 require => [Exec['download_appengine'], Package['unzip']], |
49 } | 52 } |
50 | 53 |
51 exec {'get_rietveld': | 54 exec {'get_rietveld': |
52 command => "git clone https://github.com/rietveld-codereview/rietveld.git $r
ietveld_home && cd $rietveld_home && git reset --hard 87257f5", | 55 command => shellquote( |
| 56 'hg', 'clone', $rietveld_source, '-b', $rietveld_branch, |
| 57 '-r', $rietveld_revision, $rietveld_home), |
53 user => 'root', | 58 user => 'root', |
54 require => Package['git'], | 59 require => Package['mercurial'], |
55 creates => $rietveld_home, | 60 creates => $rietveld_home, |
56 } | 61 } |
57 | 62 |
58 exec {'setup_rietveld': | 63 exec {'setup_rietveld': |
59 command => 'make update_revision mapreduce', | 64 command => 'make update_revision mapreduce', |
60 cwd => $rietveld_home, | 65 cwd => $rietveld_home, |
61 user => root, | 66 user => root, |
62 require => [Exec['get_rietveld'], Package['make', 'patch', 'subversion']], | 67 require => [Exec['get_rietveld'], Package['make', 'patch', 'subversion']], |
63 creates => "${rietveld_home}/mapreduce", | 68 creates => "${rietveld_home}/mapreduce", |
64 } | 69 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 command => "/opt/wrappers/dev_appserver.py \ | 113 command => "/opt/wrappers/dev_appserver.py \ |
109 --enable_sendmail --skip_sdk_update_check | 114 --enable_sendmail --skip_sdk_update_check |
110 --port 8080 ${rietveld_home}", | 115 --port 8080 ${rietveld_home}", |
111 user => 'rietveld', | 116 user => 'rietveld', |
112 require => [ | 117 require => [ |
113 Exec['install_appengine', 'setup_rietveld'], | 118 Exec['install_appengine', 'setup_rietveld'], |
114 File['dev_appserver.py', '_python_runtime.py', 'config.ini'], | 119 File['dev_appserver.py', '_python_runtime.py', 'config.ini'], |
115 ], | 120 ], |
116 } | 121 } |
117 } | 122 } |
OLD | NEW |