]> git.openstreetmap.org Git - chef.git/blob - cookbooks/stateofthemap/recipes/wordpress.rb
Split stateofthemap cookbook to allow parallel testing
[chef.git] / cookbooks / stateofthemap / recipes / wordpress.rb
1 #
2 # Cookbook:: stateofthemap
3 # Recipe:: wordpress
4 #
5 # Copyright:: 2022, 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 #     https://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 directory "/srv/2007.stateofthemap.org" do
25   owner "wordpress"
26   group "wordpress"
27   mode "755"
28 end
29
30 wordpress_site "2007.stateofthemap.org" do
31   aliases "2007.stateofthemap.com"
32   directory "/srv/2007.stateofthemap.org/wp"
33   database_name "sotm2007"
34   database_user "sotm2007"
35   database_password passwords["sotm2007"]
36   database_prefix "wp_sotm_"
37   fpm_prometheus_port 12007
38 end
39
40 wordpress_theme "2007.stateofthemap.org-refreshwp-11" do
41   theme "refreshwp-11"
42   site "2007.stateofthemap.org"
43   repository "https://git.openstreetmap.org/public/stateofthemap.git"
44   revision "theme-2007"
45 end
46
47 # wordpress_plugin "2007.stateofthemap.org-geopress" do
48 #   plugin "geopress"
49 #   site "2007.stateofthemap.org"
50 # end
51
52 directory "/srv/2008.stateofthemap.org" do
53   owner "wordpress"
54   group "wordpress"
55   mode "755"
56 end
57
58 wordpress_site "2008.stateofthemap.org" do
59   aliases "2008.stateofthemap.com"
60   directory "/srv/2008.stateofthemap.org/wp"
61   database_name "sotm2008"
62   database_user "sotm2008"
63   database_password passwords["sotm2008"]
64   database_prefix "wp_sotm08_"
65   fpm_prometheus_port 12008
66 end
67
68 wordpress_theme "2008.stateofthemap.org-refreshwp-11" do
69   theme "refreshwp-11"
70   site "2008.stateofthemap.org"
71   repository "https://git.openstreetmap.org/public/stateofthemap.git"
72   revision "theme-2008"
73 end
74
75 # wordpress_plugin "2008.stateofthemap.org-geopress" do
76 #   plugin "geopress"
77 #   site "2008.stateofthemap.org"
78 # end
79
80 directory "/srv/2009.stateofthemap.org" do
81   owner "wordpress"
82   group "wordpress"
83   mode "755"
84 end
85
86 git "/srv/2009.stateofthemap.org" do
87   action :sync
88   repository "https://git.openstreetmap.org/public/stateofthemap.git"
89   revision "resources-2009"
90   depth 1
91   user "wordpress"
92   group "wordpress"
93 end
94
95 wordpress_site "2009.stateofthemap.org" do
96   aliases "2009.stateofthemap.com"
97   directory "/srv/2009.stateofthemap.org/wp"
98   database_name "sotm2009"
99   database_user "sotm2009"
100   database_password passwords["sotm2009"]
101   urls "/register" => "/srv/2009.stateofthemap.org/register",
102        "/register-pro-user" => "/srv/2009.stateofthemap.org/register-pro-user",
103        "/podcasts" => "/srv/2009.stateofthemap.org/podcasts"
104   fpm_prometheus_port 12009
105 end
106
107 wordpress_theme "2009.stateofthemap.org-aerodrome" do
108   theme "aerodrome"
109   site "2009.stateofthemap.org"
110   repository "https://git.openstreetmap.org/public/stateofthemap.git"
111   revision "theme-2009"
112 end
113
114 # wordpress_plugin "2009.stateofthemap.org-wp-sticky" do
115 #   plugin "wp-sticky"
116 #   site "2009.stateofthemap.org"
117 # end
118
119 directory "/srv/2010.stateofthemap.org" do
120   owner "wordpress"
121   group "wordpress"
122   mode "755"
123 end
124
125 git "/srv/2010.stateofthemap.org" do
126   action :sync
127   repository "https://git.openstreetmap.org/public/stateofthemap.git"
128   revision "resources-2010"
129   depth 1
130   user "wordpress"
131   group "wordpress"
132 end
133
134 wordpress_site "2010.stateofthemap.org" do
135   aliases "2010.stateofthemap.com"
136   directory "/srv/2010.stateofthemap.org/wp"
137   database_name "sotm2010"
138   database_user "sotm2010"
139   database_password passwords["sotm2010"]
140   urls "/register" => "/srv/2010.stateofthemap.org/register"
141   fpm_prometheus_port 12010
142 end
143
144 wordpress_theme "2010.stateofthemap.org-aerodrome" do
145   theme "aerodrome"
146   site "2010.stateofthemap.org"
147   repository "https://git.openstreetmap.org/public/stateofthemap.git"
148   revision "theme-2010"
149 end
150
151 wordpress_plugin "2010.stateofthemap.org-sitepress-multilingual-cms" do
152   plugin "sitepress-multilingual-cms"
153   site "2010.stateofthemap.org"
154   repository "https://git.openstreetmap.org/private/sitepress-multilingual-cms.git"
155   revision "master"
156   not_if { kitchen? }
157 end
158
159 # wordpress_plugin "2010.stateofthemap.org-wp-sticky" do
160 #   plugin "wp-sticky"
161 #   site "2010.stateofthemap.org"
162 # end
163
164 directory "/srv/2011.stateofthemap.org" do
165   owner "wordpress"
166   group "wordpress"
167   mode "755"
168 end
169
170 git "/srv/2011.stateofthemap.org" do
171   action :sync
172   repository "https://git.openstreetmap.org/public/stateofthemap.git"
173   revision "resources-2011"
174   depth 1
175   user "wordpress"
176   group "wordpress"
177 end
178
179 wordpress_site "2011.stateofthemap.org" do
180   aliases "2011.stateofthemap.com"
181   directory "/srv/2011.stateofthemap.org/wp"
182   database_name "sotm2011"
183   database_user "sotm2011"
184   database_password passwords["sotm2011"]
185   urls "/register" => "/srv/2011.stateofthemap.org/register"
186   fpm_prometheus_port 12011
187 end
188
189 wordpress_theme "2011.stateofthemap.org-aerodrome" do
190   theme "aerodrome"
191   site "2011.stateofthemap.org"
192   repository "https://git.openstreetmap.org/public/stateofthemap.git"
193   revision "theme-2011"
194 end
195
196 wordpress_plugin "2011.stateofthemap.org-sitepress-multilingual-cms" do
197   plugin "sitepress-multilingual-cms"
198   site "2011.stateofthemap.org"
199   repository "https://git.openstreetmap.org/private/sitepress-multilingual-cms.git"
200   revision "master"
201   not_if { kitchen? }
202 end
203
204 # wordpress_plugin "2011.stateofthemap.org-wp-sticky" do
205 #   plugin "wp-sticky"
206 #   site "2011.stateofthemap.org"
207 # end
208
209 directory "/srv/2012.stateofthemap.org" do
210   owner "wordpress"
211   group "wordpress"
212   mode "755"
213 end
214
215 git "/srv/2012.stateofthemap.org" do
216   action :sync
217   repository "https://git.openstreetmap.org/public/stateofthemap.git"
218   revision "resources-2012"
219   depth 1
220   user "wordpress"
221   group "wordpress"
222 end
223
224 wordpress_site "2012.stateofthemap.org" do
225   aliases "2012.stateofthemap.com"
226   directory "/srv/2012.stateofthemap.org/wp"
227   database_name "sotm2012"
228   database_user "sotm2012"
229   database_password passwords["sotm2012"]
230   urls "/register" => "/srv/2012.stateofthemap.org/register"
231   fpm_prometheus_port 12012
232 end
233
234 wordpress_theme "2012.stateofthemap.org-aerodrome" do
235   theme "aerodrome"
236   site "2012.stateofthemap.org"
237   repository "https://git.openstreetmap.org/public/stateofthemap.git"
238   revision "theme-2012"
239 end
240
241 wordpress_plugin "2012.stateofthemap.org-leaflet-maps-marker" do
242   plugin "leaflet-maps-marker"
243   site "2012.stateofthemap.org"
244 end
245
246 wordpress_plugin "2012.stateofthemap.org-sitepress-multilingual-cms" do
247   plugin "sitepress-multilingual-cms"
248   site "2012.stateofthemap.org"
249   repository "https://git.openstreetmap.org/private/sitepress-multilingual-cms.git"
250   revision "master"
251   not_if { kitchen? }
252 end
253
254 # wordpress_plugin "2012.stateofthemap.org-wp-sticky" do
255 #   plugin "wp-sticky"
256 #   site "2012.stateofthemap.org"
257 # end
258
259 template "/etc/cron.daily/sotm-backup" do
260   source "backup.cron.erb"
261   owner "root"
262   group "root"
263   mode "750"
264   variables :passwords => passwords
265 end