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 "accounts"
21 include_recipe "apache"
34 directory "/srv/hardware.openstreetmap.org" do
40 git "/srv/hardware.openstreetmap.org" do
42 repository "https://github.com/osmfoundation/osmf-server-info.git"
46 notifies :run, "bundle_install[/srv/hardware.openstreetmap.org]"
49 nodes = { :rows => search(:node, "*:*") }
50 roles = { :rows => search(:role, "*:*") }
52 file "/srv/hardware.openstreetmap.org/_data/nodes.json" do
57 notifies :run, "bundle_exec[/srv/hardware.openstreetmap.org]"
61 file "/srv/hardware.openstreetmap.org/_data/roles.json" do
66 notifies :run, "bundle_exec[/srv/hardware.openstreetmap.org]"
69 bundle_config "/srv/hardware.openstreetmap.org" do
73 settings "deployment" => "true",
74 "without" => "development:test",
75 "jobs" => node.cpu_cores.to_s
76 notifies :run, "bundle_exec[/srv/hardware.openstreetmap.org]"
79 bundle_install "/srv/hardware.openstreetmap.org" do
83 notifies :run, "bundle_exec[/srv/hardware.openstreetmap.org]"
86 bundle_exec "/srv/hardware.openstreetmap.org" do
88 command "jekyll build --trace --disable-disk-cache --baseurl=https://hardware.openstreetmap.org"
91 environment "LANG" => "C.UTF-8"
94 ssl_certificate "hardware.openstreetmap.org" do
95 domains ["hardware.openstreetmap.org", "hardware.osm.org", "hardware.osmfoundation.org"]
96 notifies :reload, "service[apache2]"
99 apache_site "hardware.openstreetmap.org" do
100 template "apache.erb"
101 directory "/srv/hardware.openstreetmap.org/_site"
102 variables :aliases => ["hardware.osm.org", "hardware.osmfoundation.org"]