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"
33 git "/srv/hardware.openstreetmap.org" do
35 repository "https://github.com/osmfoundation/osmf-server-info.git"
39 notifies :run, "bundle_install[/srv/hardware.openstreetmap.org]"
42 nodes = { :rows => search(:node, "*:*") }
43 roles = { :rows => search(:role, "*:*") }
45 file "/srv/hardware.openstreetmap.org/_data/nodes.json" do
50 notifies :run, "bundle_exec[/srv/hardware.openstreetmap.org]"
53 file "/srv/hardware.openstreetmap.org/_data/roles.json" do
58 notifies :run, "bundle_exec[/srv/hardware.openstreetmap.org]"
61 directory "/srv/hardware.openstreetmap.org/_site" do
67 # FIXME: fix the the vendor directory permissions from prior root installs
68 directory "/srv/hardware.openstreetmap.org/vendor" do
75 bundle_install "/srv/hardware.openstreetmap.org" do
79 environment "BUNDLE_FROZEN" => "true",
80 "BUNDLE_WITHOUT" => "development:test",
81 "BUNDLE_PATH" => "vendor/bundle",
82 "BUNDLE_DEPLOYMENT" => "1",
83 "BUNDLE_JOBS" => node.cpu_cores.to_s
84 notifies :run, "bundle_exec[/srv/hardware.openstreetmap.org]"
87 bundle_exec "/srv/hardware.openstreetmap.org" do
89 command "jekyll build --trace --disable-disk-cache --baseurl=https://hardware.openstreetmap.org"
92 environment "LANG" => "C.UTF-8",
93 "BUNDLE_PATH" => "vendor/bundle",
94 "BUNDLE_DEPLOYMENT" => "1"
97 ssl_certificate "hardware.openstreetmap.org" do
98 domains ["hardware.openstreetmap.org", "hardware.osm.org", "hardware.osmfoundation.org"]
99 notifies :reload, "service[apache2]"
102 apache_site "hardware.openstreetmap.org" do
103 template "apache.erb"
104 directory "/srv/hardware.openstreetmap.org/_site"
105 variables :aliases => ["hardware.osm.org", "hardware.osmfoundation.org"]