]> git.openstreetmap.org Git - chef.git/blob - cookbooks/stateofthemap/recipes/default.rb
40a29c2984edc564d9b9b33959603b0708beaa4c
[chef.git] / cookbooks / stateofthemap / recipes / default.rb
1 #
2 # Cookbook Name:: stateofthemap
3 # Recipe:: default
4 #
5 # Copyright 2013, OpenStreetMap Foundation
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #     http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19
20 include_recipe "wordpress"
21
22 passwords = data_bag_item("stateofthemap", "passwords")
23
24 git "/srv/stateofthemap.org" do
25   action :sync
26   repository "git://git.openstreetmap.org/stateofthemap.git"
27   revision "chooser"
28   user "root"
29   group "root"
30 end
31
32 apache_site "stateofthemap.org" do
33   template "apache.erb"
34   directory "/srv/stateofthemap.org"
35 end
36
37 directory "/srv/2007.stateofthemap.org" do
38   owner "wordpress"
39   group "wordpress"
40   mode 0755
41 end
42
43 wordpress_site "2007.stateofthemap.org" do
44   aliases "2007.stateofthemap.com"
45   directory "/srv/2007.stateofthemap.org/wp"
46   ssl_enabled true
47   database_name "sotm2007"
48   database_user "sotm2007"
49   database_password passwords["sotm2007"]
50   database_prefix "wp_sotm_"
51 end
52
53 wordpress_theme "refreshwp-11" do
54   site "2007.stateofthemap.org"
55   repository "git://git.openstreetmap.org/stateofthemap.git"
56   revision "theme-2007"
57 end
58
59 wordpress_plugin "geopress" do
60   site "2007.stateofthemap.org"
61 end
62
63 wordpress_plugin "sem-static-front" do
64   site "2007.stateofthemap.org"
65   repository "git://chef.openstreetmap.org/sem-static-front.git"
66 end
67
68 directory "/srv/2008.stateofthemap.org" do
69   owner "wordpress"
70   group "wordpress"
71   mode 0755
72 end
73
74 wordpress_site "2008.stateofthemap.org" do
75   aliases "2008.stateofthemap.com"
76   directory "/srv/2008.stateofthemap.org/wp"
77   ssl_enabled true
78   database_name "sotm2008"
79   database_user "sotm2008"
80   database_password passwords["sotm2008"]
81   database_prefix "wp_sotm08_"
82 end
83
84 wordpress_theme "refreshwp-11" do
85   site "2008.stateofthemap.org"
86   repository "git://git.openstreetmap.org/stateofthemap.git"
87   revision "theme-2008"
88 end
89
90 wordpress_plugin "geopress" do
91   site "2008.stateofthemap.org"
92 end
93
94 directory "/srv/2009.stateofthemap.org" do
95   owner "wordpress"
96   group "wordpress"
97   mode 0755
98 end
99
100 git "/srv/2009.stateofthemap.org" do
101   action :sync
102   repository "git://git.openstreetmap.org/stateofthemap.git"
103   revision "resources-2009"
104   user "wordpress"
105   group "wordpress"
106 end
107
108 wordpress_site "2009.stateofthemap.org" do
109   aliases "2009.stateofthemap.com"
110   directory "/srv/2009.stateofthemap.org/wp"
111   ssl_enabled true
112   database_name "sotm2009"
113   database_user "sotm2009"
114   database_password passwords["sotm2009"]
115   urls "/register" => "/srv/2009.stateofthemap.org/register",
116        "/register-pro-user" => "/srv/2009.stateofthemap.org/register-pro-user",
117        "/podcasts" => "/srv/2009.stateofthemap.org/podcasts"
118 end
119
120 wordpress_theme "aerodrome" do
121   site "2009.stateofthemap.org"
122   repository "git://git.openstreetmap.org/stateofthemap.git"
123   revision "theme-2009"
124 end
125
126 wordpress_plugin "wp-sticky" do
127   site "2009.stateofthemap.org"
128 end
129
130 directory "/srv/2010.stateofthemap.org" do
131   owner "wordpress"
132   group "wordpress"
133   mode 0755
134 end
135
136 git "/srv/2010.stateofthemap.org" do
137   action :sync
138   repository "git://git.openstreetmap.org/stateofthemap.git"
139   revision "resources-2010"
140   user "wordpress"
141   group "wordpress"
142 end
143
144 wordpress_site "2010.stateofthemap.org" do
145   aliases "2010.stateofthemap.com"
146   directory "/srv/2010.stateofthemap.org/wp"
147   ssl_enabled true
148   database_name "sotm2010"
149   database_user "sotm2010"
150   database_password passwords["sotm2010"]
151   urls "/register" => "/srv/2010.stateofthemap.org/register"
152 end
153
154 wordpress_theme "aerodrome" do
155   site "2010.stateofthemap.org"
156   repository "git://git.openstreetmap.org/stateofthemap.git"
157   revision "theme-2010"
158 end
159
160 wordpress_plugin "sitepress-multilingual-cms" do
161   site "2010.stateofthemap.org"
162   repository "git://chef.openstreetmap.org/sitepress-multilingual-cms.git"
163 end
164
165 wordpress_plugin "wp-sticky" do
166   site "2010.stateofthemap.org"
167 end
168
169 directory "/srv/2011.stateofthemap.org" do
170   owner "wordpress"
171   group "wordpress"
172   mode 0755
173 end
174
175 git "/srv/2011.stateofthemap.org" do
176   action :sync
177   repository "git://git.openstreetmap.org/stateofthemap.git"
178   revision "resources-2011"
179   user "wordpress"
180   group "wordpress"
181 end
182
183 wordpress_site "2011.stateofthemap.org" do
184   aliases "2011.stateofthemap.com"
185   directory "/srv/2011.stateofthemap.org/wp"
186   ssl_enabled true
187   database_name "sotm2011"
188   database_user "sotm2011"
189   database_password passwords["sotm2011"]
190   urls "/register" => "/srv/2011.stateofthemap.org/register"
191 end
192
193 wordpress_theme "aerodrome" do
194   site "2011.stateofthemap.org"
195   repository "git://git.openstreetmap.org/stateofthemap.git"
196   revision "theme-2011"
197 end
198
199 wordpress_plugin "sitepress-multilingual-cms" do
200   site "2011.stateofthemap.org"
201   repository "git://chef.openstreetmap.org/sitepress-multilingual-cms.git"
202 end
203
204 wordpress_plugin "wp-sticky" do
205   site "2011.stateofthemap.org"
206 end
207
208 directory "/srv/2012.stateofthemap.org" do
209   owner "wordpress"
210   group "wordpress"
211   mode 0755
212 end
213
214 git "/srv/2012.stateofthemap.org" do
215   action :sync
216   repository "git://git.openstreetmap.org/stateofthemap.git"
217   revision "resources-2012"
218   user "wordpress"
219   group "wordpress"
220 end
221
222 wordpress_site "2012.stateofthemap.org" do
223   aliases "2012.stateofthemap.com"
224   directory "/srv/2012.stateofthemap.org/wp"
225   ssl_enabled true
226   database_name "sotm2012"
227   database_user "sotm2012"
228   database_password passwords["sotm2012"]
229   urls "/register" => "/srv/2012.stateofthemap.org/register"
230 end
231
232 wordpress_theme "aerodrome" do
233   site "2012.stateofthemap.org"
234   repository "git://git.openstreetmap.org/stateofthemap.git"
235   revision "theme-2012"
236 end
237
238 wordpress_plugin "leaflet-maps-marker" do
239   site "2012.stateofthemap.org"
240 end
241
242 wordpress_plugin "sitepress-multilingual-cms" do
243   site "2012.stateofthemap.org"
244   repository "git://chef.openstreetmap.org/sitepress-multilingual-cms.git"
245 end
246
247 wordpress_plugin "wp-sticky" do
248   site "2012.stateofthemap.org"
249 end
250
251 directory "/srv/2016.stateofthemap.org" do
252   owner "wordpress"
253   group "wordpress"
254   mode 0755
255 end
256
257 wordpress_site "2016.stateofthemap.org" do
258   aliases ["2016.stateofthemap.com",
259            "www.stateofthemap.org", "stateofthemap.org",
260            "www.stateofthemap.com", "stateofthemap.com"]
261   directory "/srv/2016.stateofthemap.org/wp"
262   ssl_enabled true
263   database_name "sotm2016"
264   database_user "sotm2016"
265   database_password passwords["sotm2016"]
266 end
267
268 wordpress_theme "aerodrome" do
269   site "2016.stateofthemap.org"
270   repository "git://git.openstreetmap.org/stateofthemap.git"
271   revision "theme-2012"
272 end
273
274 wordpress_plugin "leaflet-maps-marker" do
275   site "2016.stateofthemap.org"
276 end
277
278 wordpress_plugin "sitepress-multilingual-cms" do
279   site "2016.stateofthemap.org"
280   repository "git://chef.openstreetmap.org/sitepress-multilingual-cms.git"
281 end
282
283 wordpress_plugin "wp-sticky" do
284   site "2016.stateofthemap.org"
285 end
286
287 template "/etc/cron.daily/sotm-backup" do
288   source "backup.cron.erb"
289   owner "root"
290   group "root"
291   mode 0750
292   variables :passwords => passwords
293 end