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[2013].each do |year|
 
 270   git "/srv/#{year}.stateofthemap.org" do
 
 272     repository "git://git.openstreetmap.org/stateofthemap.git"
 
 273     revision "site-#{year}"
 
 278   ssl_certificate "#{year}.stateofthemap.org" do
 
 279     domains ["#{year}.stateofthemap.org", "#{year}.stateofthemap.com"]
 
 280     notifies :reload, "service[apache2]"
 
 283   apache_site "#{year}.stateofthemap.org" do
 
 284     template "apache.static.erb"
 
 285     directory "/srv/#{year}.stateofthemap.org"
 
 286     variables :year => year
 
 290 %w[2016 2017 2018].each do |year|
 
 291   git "/srv/#{year}.stateofthemap.org" do
 
 293     repository "git://github.com/openstreetmap/stateofthemap-#{year}.git"
 
 296     notifies :run, "execute[/srv/#{year}.stateofthemap.org]"
 
 299   directory "/srv/#{year}.stateofthemap.org/_site" do
 
 305   execute "/srv/#{year}.stateofthemap.org" do
 
 307     command "jekyll build --trace"
 
 308     cwd "/srv/#{year}.stateofthemap.org"
 
 313   ssl_certificate "#{year}.stateofthemap.org" do
 
 314     domains ["#{year}.stateofthemap.org", "#{year}.stateofthemap.com"]
 
 315     notifies :reload, "service[apache2]"
 
 318   apache_site "#{year}.stateofthemap.org" do
 
 319     template "apache.jekyll.erb"
 
 320     directory "/srv/#{year}.stateofthemap.org/_site"
 
 321     variables :year => year
 
 325 template "/etc/cron.daily/sotm-backup" do
 
 326   source "backup.cron.erb"
 
 330   variables :passwords => passwords