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

Delta Between Two Patch Sets: modules/rietveld/manifests/init.pp

Issue 6155422901731328: Run Rietveld using the AppEngine SDK (Closed)
Left Patch Set: Created June 2, 2015, 8:59 p.m.
Right Patch Set: Addressed comments and added caching Created June 4, 2015, 9:19 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
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 $fixtures = hiera('rietveld::fixtures', {}), 7 $admins = hiera('rietveld::admins', []),
8 $database = hiera('rietveld::database', { 8 $oauth2_client_id = hiera('rietveld::oauth2_client_id', ''),
9 'engine' => 'sqlite3', 9 $oauth2_client_secret = hiera('rietveld::oauth2_client_secret', ''),
10 'name' => 'dev.db',
11 }),
12 ) { 10 ) {
13 11
14 include nginx 12 include nginx
15 $rietveld_home = '/opt/rietveld' 13 $rietveld_home = '/opt/rietveld'
16 14
17 Exec { 15 Exec {
18 path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', 16 path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin',
19 } 17 }
20 18
21 nginx::hostconfig {$domain: 19 nginx::hostconfig {$domain:
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 ensure => link, 89 ensure => link,
92 require => File['wrapper.py'], 90 require => File['wrapper.py'],
93 target => '/opt/wrappers/wrapper.py', 91 target => '/opt/wrappers/wrapper.py',
94 } 92 }
95 93
96 file {'/var/lib/rietveld': 94 file {'/var/lib/rietveld':
97 ensure => directory, 95 ensure => directory,
98 owner => 'rietveld', 96 owner => 'rietveld',
99 } 97 }
100 98
101 file {'cookie_secret': 99 file {'config.ini':
102 path => '/var/lib/rietveld/cookie_secret', 100 path => '/var/lib/rietveld/config.ini',
103 ensure => file, 101 ensure => file,
104 owner => 'root', 102 owner => 'root',
105 content => $secret_key, 103 content => template('rietveld/config.ini.erb'),
106 notify => Service['rietveld'], 104 notify => Service['rietveld'],
107 } 105 }
108 106
109 customservice {'rietveld': 107 customservice {'rietveld':
110 command => "/opt/wrappers/dev_appserver.py \ 108 command => "/opt/wrappers/dev_appserver.py \
111 --skip_sdk_update_check --port 8080 ${rietveld_home}", 109 --enable_sendmail --skip_sdk_update_check
110 --port 8080 ${rietveld_home}",
112 user => 'rietveld', 111 user => 'rietveld',
113 require => [ 112 require => [
114 Exec['install_appengine', 'setup_rietveld'], 113 Exec['install_appengine', 'setup_rietveld'],
115 File['dev_appserver.py', '_python_runtime.py', 'cookie_secret'], 114 File['dev_appserver.py', '_python_runtime.py', 'config.ini'],
116 ], 115 ],
117 } 116 }
118
119 # file {"${rietveld_home}/fixtures":
120 # ensure => directory,
121 # owner => 'rietveld',
122 # mode => 0750,
123 # require => Exec['install_rietveld'],
124 # }
125
126 define fixture(
127 $ensure = present,
128 $source = undef,
129 $content = undef,
130 ) {
131
132 # Note that $script will return EXIT_SUCCESS when the .type is
133 # not recognized - although no action is done then. Thus we enforce
134 # JSON here, which is the default for command "dumpdata" anyway:
135 $script = "${rietveld::rietveld_home}/manage.py"
136 $destination = "${rietveld::rietveld_home}/fixtures/$name.json"
137
138 exec {$destination:
139 command => shellquote($script, 'loaddata', $destination),
140 cwd => $rietveld::rietveld_home,
141 refreshonly => true,
142 user => 'rietveld',
143 }
144
145 file {$destination:
146 ensure => $ensure,
147 content => $content,
148 source => $source,
149 owner => 'rietveld',
150 mode => 0640,
151 notify => $ensure ? {
152 present => Exec[$destination],
153 default => [],
154 }
155 }
156 }
157
158 # create_resources(rietveld::fixture, $fixtures)
159 } 117 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld