2 # Cookbook:: serverinfo
5 # Copyright:: 2015, 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 # https://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 "apache"
31 gem_package "bundler" do
35 git "/srv/hardware.openstreetmap.org" do
37 repository "https://github.com/gravitystorm/osmf-server-info.git"
40 notifies :run, "execute[/srv/hardware.openstreetmap.org/Gemfile]"
43 nodes = { :rows => search(:node, "*:*") }
44 roles = { :rows => search(:role, "*:*") }
46 file "/srv/hardware.openstreetmap.org/_data/nodes.json" do
51 notifies :run, "execute[/srv/hardware.openstreetmap.org]"
54 file "/srv/hardware.openstreetmap.org/_data/roles.json" do
59 notifies :run, "execute[/srv/hardware.openstreetmap.org]"
62 directory "/srv/hardware.openstreetmap.org/_site" do
68 # Workaround https://github.com/jekyll/jekyll/issues/7804
69 # by creating a .jekyll-cache folder
70 directory "/srv/hardware.openstreetmap.org/.jekyll-cache" do
76 execute "/srv/hardware.openstreetmap.org/Gemfile" do
78 command "bundle install --deployment"
79 cwd "/srv/hardware.openstreetmap.org"
82 notifies :run, "execute[/srv/hardware.openstreetmap.org]"
85 execute "/srv/hardware.openstreetmap.org" do
87 command "bundle exec jekyll build --trace --baseurl=https://hardware.openstreetmap.org"
88 cwd "/srv/hardware.openstreetmap.org"
93 ssl_certificate "hardware.openstreetmap.org" do
94 domains ["hardware.openstreetmap.org", "hardware.osm.org"]
95 notifies :reload, "service[apache2]"
98 apache_site "hardware.openstreetmap.org" do
100 directory "/srv/hardware.openstreetmap.org/_site"
101 variables :aliases => ["hardware.osm.org"]