2 # Cookbook Name:: stateofthemap
5 # Copyright 2013, OpenStreetMap Foundation
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
11 # http://www.apache.org/licenses/LICENSE-2.0
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.
20 include_recipe "wordpress"
22 passwords = data_bag_item("stateofthemap", "passwords")
24 git "/srv/stateofthemap.org" do
26 repository "git://git.openstreetmap.org/stateofthemap.git"
32 ssl_certificate "stateofthemap.org" do
33 domains ["stateofthemap.org", "www.stateofthemap.org",
34 "stateofthemap.com", "www.stateofthemap.com",
35 "sotm.org", "www.sotm.org"]
36 notifies :reload, "service[apache2]"
39 apache_site "stateofthemap.org" do
41 directory "/srv/stateofthemap.org"
44 directory "/srv/2007.stateofthemap.org" do
50 wordpress_site "2007.stateofthemap.org" do
51 aliases "2007.stateofthemap.com"
52 directory "/srv/2007.stateofthemap.org/wp"
54 database_name "sotm2007"
55 database_user "sotm2007"
56 database_password passwords["sotm2007"]
57 database_prefix "wp_sotm_"
60 wordpress_theme "2007.stateofthemap.org-refreshwp-11" do
62 site "2007.stateofthemap.org"
63 repository "git://git.openstreetmap.org/stateofthemap.git"
67 wordpress_plugin "2007.stateofthemap.org-geopress" do
69 site "2007.stateofthemap.org"
72 directory "/srv/2008.stateofthemap.org" do
78 wordpress_site "2008.stateofthemap.org" do
79 aliases "2008.stateofthemap.com"
80 directory "/srv/2008.stateofthemap.org/wp"
82 database_name "sotm2008"
83 database_user "sotm2008"
84 database_password passwords["sotm2008"]
85 database_prefix "wp_sotm08_"
88 wordpress_theme "2008.stateofthemap.org-refreshwp-11" do
90 site "2008.stateofthemap.org"
91 repository "git://git.openstreetmap.org/stateofthemap.git"
95 wordpress_plugin "2008.stateofthemap.org-geopress" do
97 site "2008.stateofthemap.org"
100 directory "/srv/2009.stateofthemap.org" do
106 git "/srv/2009.stateofthemap.org" do
108 repository "git://git.openstreetmap.org/stateofthemap.git"
109 revision "resources-2009"
114 wordpress_site "2009.stateofthemap.org" do
115 aliases "2009.stateofthemap.com"
116 directory "/srv/2009.stateofthemap.org/wp"
118 database_name "sotm2009"
119 database_user "sotm2009"
120 database_password passwords["sotm2009"]
121 urls "/register" => "/srv/2009.stateofthemap.org/register",
122 "/register-pro-user" => "/srv/2009.stateofthemap.org/register-pro-user",
123 "/podcasts" => "/srv/2009.stateofthemap.org/podcasts"
126 wordpress_theme "2009.stateofthemap.org-aerodrome" do
128 site "2009.stateofthemap.org"
129 repository "git://git.openstreetmap.org/stateofthemap.git"
130 revision "theme-2009"
133 wordpress_plugin "2009.stateofthemap.org-wp-sticky" do
135 site "2009.stateofthemap.org"
138 directory "/srv/2010.stateofthemap.org" do
144 git "/srv/2010.stateofthemap.org" do
146 repository "git://git.openstreetmap.org/stateofthemap.git"
147 revision "resources-2010"
152 wordpress_site "2010.stateofthemap.org" do
153 aliases "2010.stateofthemap.com"
154 directory "/srv/2010.stateofthemap.org/wp"
156 database_name "sotm2010"
157 database_user "sotm2010"
158 database_password passwords["sotm2010"]
159 urls "/register" => "/srv/2010.stateofthemap.org/register"
162 wordpress_theme "2010.stateofthemap.org-aerodrome" do
164 site "2010.stateofthemap.org"
165 repository "git://git.openstreetmap.org/stateofthemap.git"
166 revision "theme-2010"
169 wordpress_plugin "2010.stateofthemap.org-sitepress-multilingual-cms" do
170 name "sitepress-multilingual-cms"
171 site "2010.stateofthemap.org"
172 repository "git://chef.openstreetmap.org/sitepress-multilingual-cms.git"
175 wordpress_plugin "2010.stateofthemap.org-wp-sticky" do
177 site "2010.stateofthemap.org"
180 directory "/srv/2011.stateofthemap.org" do
186 git "/srv/2011.stateofthemap.org" do
188 repository "git://git.openstreetmap.org/stateofthemap.git"
189 revision "resources-2011"
194 wordpress_site "2011.stateofthemap.org" do
195 aliases "2011.stateofthemap.com"
196 directory "/srv/2011.stateofthemap.org/wp"
198 database_name "sotm2011"
199 database_user "sotm2011"
200 database_password passwords["sotm2011"]
201 urls "/register" => "/srv/2011.stateofthemap.org/register"
204 wordpress_theme "2011.stateofthemap.org-aerodrome" do
206 site "2011.stateofthemap.org"
207 repository "git://git.openstreetmap.org/stateofthemap.git"
208 revision "theme-2011"
211 wordpress_plugin "2011.stateofthemap.org-sitepress-multilingual-cms" do
212 name "sitepress-multilingual-cms"
213 site "2011.stateofthemap.org"
214 repository "git://chef.openstreetmap.org/sitepress-multilingual-cms.git"
217 wordpress_plugin "2011.stateofthemap.org-wp-sticky" do
219 site "2011.stateofthemap.org"
222 directory "/srv/2012.stateofthemap.org" do
228 git "/srv/2012.stateofthemap.org" do
230 repository "git://git.openstreetmap.org/stateofthemap.git"
231 revision "resources-2012"
236 wordpress_site "2012.stateofthemap.org" do
237 aliases "2012.stateofthemap.com"
238 directory "/srv/2012.stateofthemap.org/wp"
240 database_name "sotm2012"
241 database_user "sotm2012"
242 database_password passwords["sotm2012"]
243 urls "/register" => "/srv/2012.stateofthemap.org/register"
246 wordpress_theme "2012.stateofthemap.org-aerodrome" do
248 site "2012.stateofthemap.org"
249 repository "git://git.openstreetmap.org/stateofthemap.git"
250 revision "theme-2012"
253 wordpress_plugin "2012.stateofthemap.org-leaflet-maps-marker" do
254 name "leaflet-maps-marker"
255 site "2012.stateofthemap.org"
258 wordpress_plugin "2012.stateofthemap.org-sitepress-multilingual-cms" do
259 name "sitepress-multilingual-cms"
260 site "2012.stateofthemap.org"
261 repository "git://chef.openstreetmap.org/sitepress-multilingual-cms.git"
264 wordpress_plugin "2012.stateofthemap.org-wp-sticky" do
266 site "2012.stateofthemap.org"
269 %w[2016 2017 2018].each do |year|
270 git "/srv/#{year}.stateofthemap.org" do
272 repository "git://github.com/openstreetmap/stateofthemap-#{year}.git"
275 notifies :run, "execute[/srv/#{year}.stateofthemap.org]"
278 directory "/srv/#{year}.stateofthemap.org/_site" do
284 execute "/srv/#{year}.stateofthemap.org" do
286 command "jekyll build --trace"
287 cwd "/srv/#{year}.stateofthemap.org"
292 ssl_certificate "#{year}.stateofthemap.org" do
293 domains ["#{year}.stateofthemap.org", "#{year}.stateofthemap.com"]
294 notifies :reload, "service[apache2]"
297 apache_site "#{year}.stateofthemap.org" do
298 template "apache.jekyll.erb"
299 directory "/srv/#{year}.stateofthemap.org/_site"
300 variables :year => year
304 template "/etc/cron.daily/sotm-backup" do
305 source "backup.cron.erb"
309 variables :passwords => passwords