]> git.openstreetmap.org Git - chef.git/commitdiff
Merge remote-tracking branch 'github/pull/575'
authorTom Hughes <tom@compton.nu>
Sun, 12 Feb 2023 18:35:15 +0000 (18:35 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 12 Feb 2023 18:35:15 +0000 (18:35 +0000)
.github/workflows/test-kitchen.yml
.kitchen.yml
cookbooks/stateofthemap/recipes/container.rb [moved from cookbooks/stateofthemap/recipes/jekyll.rb with 88% similarity]
cookbooks/stateofthemap/recipes/static.rb [deleted file]
cookbooks/stateofthemap/templates/default/apache.container.erb [moved from cookbooks/stateofthemap/templates/default/apache.jekyll.erb with 100% similarity]
cookbooks/stateofthemap/templates/default/apache.static.erb [deleted file]
roles/naga.rb
roles/stateofthemap.rb
test/integration/stateofthemap-container/serverspec/apache_spec.rb [moved from test/integration/stateofthemap-jekyll/serverspec/apache_spec.rb with 100% similarity]
test/integration/stateofthemap-static/serverspec/apache_spec.rb [deleted file]

index ca58e547e79f9118c3a82af7208e90ba9c464ef9..2469ab522bc67dadbf4cca6e9604e29e39610bab 100644 (file)
@@ -97,8 +97,7 @@ jobs:
           - spamassassin
           - ssl
           - stateofthemap
-          - stateofthemap-jekyll
-          - stateofthemap-static
+          - stateofthemap-container
           - stateofthemap-wordpress
           - subversion
           - supybot
index 2e7ae9638c9bc743ef105d038f23fb1c2fe1675f..c867618c0e6f93fe18e45dc4ae257e70c18416c1 100644 (file)
@@ -340,12 +340,9 @@ suites:
   - name: stateofthemap
     run_list:
       - recipe[stateofthemap::default]
-  - name: stateofthemap-static
+  - name: stateofthemap-container
     run_list:
-      - recipe[stateofthemap::static]
-  - name: stateofthemap-jekyll
-    run_list:
-      - recipe[stateofthemap::jekyll]
+      - recipe[stateofthemap::container]
   - name: stateofthemap-wordpress
     run_list:
       - recipe[stateofthemap::wordpress]
similarity index 88%
rename from cookbooks/stateofthemap/recipes/jekyll.rb
rename to cookbooks/stateofthemap/recipes/container.rb
index c4e00801656f02cc094c2971b5b74a666e5674a1..b5a7640acd8fcb112cc33e3b100e911f8f920887 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Cookbook:: stateofthemap
-# Recipe:: jekyll
+# Recipe:: container
 #
 # Copyright:: 2022, OpenStreetMap Foundation
 #
@@ -22,8 +22,8 @@ include_recipe "podman"
 
 apache_module "proxy_http"
 
-%w[2016 2017 2018 2019 2020 2021 2022].each do |year|
-  docker_external_port = 6080 + year.to_i # 8096+
+%w[2013 2016 2017 2018 2019 2020 2021 2022].each do |year|
+  docker_external_port = 6080 + year.to_i # 8093+
 
   podman_service "#{year}.stateofthemap.org" do
     description "Container service for #{year}.stateofthemap.org"
@@ -37,7 +37,7 @@ apache_module "proxy_http"
   end
 
   apache_site "#{year}.stateofthemap.org" do
-    template "apache.jekyll.erb"
+    template "apache.container.erb"
     variables :docker_external_port => docker_external_port, :aliases => ["#{year}.stateofthemap.com", "#{year}.sotm.org"]
   end
 end
diff --git a/cookbooks/stateofthemap/recipes/static.rb b/cookbooks/stateofthemap/recipes/static.rb
deleted file mode 100644 (file)
index 2ed4361..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# Cookbook:: stateofthemap
-# Recipe:: static
-#
-# Copyright:: 2022, OpenStreetMap Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-include_recipe "stateofthemap"
-
-%w[2013].each do |year|
-  git "/srv/#{year}.stateofthemap.org" do
-    action :sync
-    repository "https://git.openstreetmap.org/public/stateofthemap.git"
-    revision "site-#{year}"
-    depth 1
-    user "root"
-    group "root"
-  end
-
-  ssl_certificate "#{year}.stateofthemap.org" do
-    domains ["#{year}.stateofthemap.org", "#{year}.stateofthemap.com", "#{year}.sotm.org"]
-    notifies :reload, "service[apache2]"
-  end
-
-  apache_site "#{year}.stateofthemap.org" do
-    template "apache.static.erb"
-    directory "/srv/#{year}.stateofthemap.org"
-    variables :year => year
-  end
-end
diff --git a/cookbooks/stateofthemap/templates/default/apache.static.erb b/cookbooks/stateofthemap/templates/default/apache.static.erb
deleted file mode 100644 (file)
index 07ec18c..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-# DO NOT EDIT - This file is being maintained by Chef
-
-<VirtualHost *:80>
-        ServerName <%= @year %>.stateofthemap.org
-        ServerAlias <%= @year %>.stateofthemap.com <%= @year %>.sotm.org
-        ServerAdmin webmaster@openstreetmap.org
-
-        CustomLog /var/log/apache2/<%= @year %>.stateofthemap.org-access.log combined
-        ErrorLog /var/log/apache2/<%= @year %>.stateofthemap.org-error.log
-
-        RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
-        RedirectPermanent / https://<%= @year %>.stateofthemap.org/
-</VirtualHost>
-
-<VirtualHost *:443>
-        ServerName <%= @year %>.stateofthemap.com
-        ServerAlias <%= @year %>.sotm.org
-        ServerAdmin webmaster@openstreetmap.org
-
-        CustomLog /var/log/apache2/<%= @year %>.stateofthemap.org-access.log combined
-        ErrorLog /var/log/apache2/<%= @year %>.stateofthemap.org-error.log
-
-        SSLEngine on
-        SSLCertificateFile /etc/ssl/certs/<%= @year %>.stateofthemap.org.pem
-        SSLCertificateKeyFile /etc/ssl/private/<%= @year %>.stateofthemap.org.key
-
-        RedirectPermanent / https://<%= @year %>.stateofthemap.org/
-</VirtualHost>
-
-<VirtualHost *:443>
-        ServerName <%= @year %>.stateofthemap.org
-        ServerAdmin webmaster@openstreetmap.org
-
-        CustomLog /var/log/apache2/<%= @year %>.stateofthemap.org-access.log combined
-        ErrorLog /var/log/apache2/<%= @year %>.stateofthemap.org-error.log
-
-        SSLEngine on
-        SSLCertificateFile /etc/ssl/certs/<%= @year %>.stateofthemap.org.pem
-        SSLCertificateKeyFile /etc/ssl/private/<%= @year %>.stateofthemap.org.key
-
-        DocumentRoot /srv/<%= @year %>.stateofthemap.org
-
-        ErrorDocument 404 /404.html
-
-        ExpiresActive On
-        ExpiresDefault "access plus 7 days"
-</VirtualHost>
-
-<Directory /srv/<%= @year %>.stateofthemap.org>
-        Require all granted
-</Directory>
index 20ce1b557ed62df7cab327c2df1225b7b67a284d..9710563c472f2d3b3ee760ddf5a8b409ce2bac5b 100644 (file)
@@ -41,5 +41,5 @@ run_list(
   "role[blogs]",
   "role[munin]",
   "recipe[foundation::welcome]",
-  "recipe[stateofthemap::jekyll]"
+  "recipe[stateofthemap::container]"
 )
index 6e1d9ab1bb270b62a8e0e1e247001a5559832792..512a038b41dccaafadaa6211654286b20c56ee38 100644 (file)
@@ -3,6 +3,5 @@ description "Role applied to State of the Map servers"
 
 run_list(
   "recipe[stateofthemap]",
-  "recipe[stateofthemap::static]",
   "recipe[stateofthemap::wordpress]"
 )
diff --git a/test/integration/stateofthemap-static/serverspec/apache_spec.rb b/test/integration/stateofthemap-static/serverspec/apache_spec.rb
deleted file mode 100644 (file)
index 446d3b9..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-require "serverspec"
-
-# Required by serverspec
-set :backend, :exec
-
-describe package("apache2") do
-  it { should be_installed }
-end
-
-describe service("apache2") do
-  it { should be_enabled }
-  it { should be_running }
-end
-
-describe port(80) do
-  it { should be_listening.with("tcp") }
-end
-
-describe port(443) do
-  it { should be_listening.with("tcp") }
-end