]> git.openstreetmap.org Git - chef.git/blob - cookbooks/blog/recipes/staging.rb
Switch community site to fume
[chef.git] / cookbooks / blog / recipes / staging.rb
1 #
2 # Cookbook:: blog
3 # Recipe:: staging
4 #
5 # Copyright:: 2024, 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("blog-staging", "passwords")
23 wp2fa_encrypt_keys = data_bag_item("blog-staging", "wp2fa_encrypt_keys")
24
25 directory "/srv/staging.blog.openstreetmap.org" do
26   owner "wordpress"
27   group "wordpress"
28   mode "755"
29 end
30
31 wordpress_site "staging.blog.openstreetmap.org" do
32   aliases ["staging.blog.osm.org", "staging.blog.openstreetmap.com",
33            "staging.blog.openstreetmap.net", "staging.blog.openstreetmaps.org",
34            "staging.blog.osmfoundation.org"
35           ]
36   directory "/srv/staging.blog.openstreetmap.org/wp"
37   database_name "osm-blog-staging"
38   database_user "osm-blog-staging-user"
39   database_password passwords["osm-blog-staging-user"]
40   wp2fa_encrypt_key wp2fa_encrypt_keys["key"]
41   urls "/casts" => "/srv/staging.blog.openstreetmap.org/casts",
42        "/images" => "/srv/staging.blog.openstreetmap.org/images",
43        "/static" => "/srv/staging.blog.openstreetmap.org/static"
44   fpm_prometheus_port 11401
45 end
46
47 wordpress_theme "staging.blog.openstreetmap.org-osmblog-wp-theme" do
48   theme "osmblog-wp-theme"
49   site "staging.blog.openstreetmap.org"
50   repository "https://github.com/osmfoundation/osmblog-wp-theme.git"
51 end
52
53 wordpress_plugin "staging.blog.openstreetmap.org-google-analytics-for-wordpress" do
54   action :delete
55   plugin "google-analytics-for-wordpress"
56   site "staging.blog.openstreetmap.org"
57 end
58
59 wordpress_plugin "staging.blog.openstreetmap.org-google-sitemap-generator" do
60   action :delete
61   plugin "google-sitemap-generator"
62   site "staging.blog.openstreetmap.org"
63 end
64
65 # wordpress_plugin "blog.openstreetmap.org-www-xml-sitemap-generator-org" do
66 #   plugin "www-xml-sitemap-generator-org"
67 #   site "staging.blog.openstreetmap.org"
68 # end
69
70 wordpress_plugin "staging.blog.openstreetmap.org-shareadraft" do
71   action :delete
72   plugin "shareadraft"
73   site "staging.blog.openstreetmap.org"
74 end
75
76 wordpress_plugin "staging.blog.openstreetmap.org-public-post-preview" do
77   plugin "public-post-preview"
78   site "staging.blog.openstreetmap.org"
79 end
80
81 wordpress_plugin "staging.blog.openstreetmap.org-sitepress-multilingual-cms" do
82   plugin "sitepress-multilingual-cms"
83   site "staging.blog.openstreetmap.org"
84   repository "https://git.openstreetmap.org/private/sitepress-multilingual-cms.git"
85   revision "master"
86   not_if { kitchen? }
87 end
88
89 wordpress_plugin "staging.blog.openstreetmap.org-wordpress-importer" do
90   action :delete
91   plugin "wordpress-importer"
92   site "staging.blog.openstreetmap.org"
93 end
94
95 wordpress_plugin "staging.blog.openstreetmap.org-wp-piwik" do
96   plugin "wp-piwik"
97   site "staging.blog.openstreetmap.org"
98 end
99
100 git "/srv/staging.blog.openstreetmap.org/casts" do
101   action :sync
102   repository "https://github.com/openstreetmap/opengeodata-podcasts.git"
103   revision "master"
104   depth 1
105   user "wordpress"
106   group "wordpress"
107 end
108
109 git "/srv/staging.blog.openstreetmap.org/images" do
110   action :sync
111   repository "https://github.com/openstreetmap/opengeodata-images.git"
112   revision "master"
113   depth 1
114   user "wordpress"
115   group "wordpress"
116 end
117
118 git "/srv/staging.blog.openstreetmap.org/static" do
119   action :sync
120   repository "https://github.com/openstreetmap/opengeodata-static.git"
121   revision "master"
122   depth 1
123   user "wordpress"
124   group "wordpress"
125 end
126
127 template "/etc/cron.daily/blog-staging-backup" do
128   source "backup-staging.cron.erb"
129   owner "root"
130   group "root"
131   mode "750"
132   variables :passwords => passwords
133 end