]> git.openstreetmap.org Git - chef.git/commitdiff
Avoid hard coding the font fetcher script details
authorTom Hughes <tom@compton.nu>
Sat, 6 Aug 2022 14:47:39 +0000 (15:47 +0100)
committerTom Hughes <tom@compton.nu>
Sat, 6 Aug 2022 14:50:30 +0000 (15:50 +0100)
cookbooks/tile/recipes/default.rb
roles/tile.rb

index 36c3185696e5a29e87b69abae578981e0d897999..70085058d71288c82acdc0dbb2384fe9f41dc406 100644 (file)
@@ -362,19 +362,15 @@ node[:tile][:styles].each do |name, details|
     group "tile"
   end
 
-  link "#{style_directory}/fonts" do
-    to "/srv/tile.openstreetmap.org/fonts"
-    owner "tile"
-    group "tile"
-  end
-
-  execute "#{style_directory}/fonts" do
-    action :nothing
-    command "scripts/get-fonts.sh"
-    cwd style_directory
-    user "tile"
-    group "tile"
-    subscribes :run, "git[#{style_directory}]"
+  if details[:fonts_script]
+    execute details[:fonts_script] do
+      action :nothing
+      command details[:fonts_script]
+      cwd style_directory
+      user "tile"
+      group "tile"
+      subscribes :run, "git[#{style_directory}]"
+    end
   end
 
   execute "#{style_directory}/project.mml" do
index c188be8d58d1a432f94fdc51d6ff27df4bd09e5f..25407d75b52982409e83ba83005cb6c1a2a4e845 100644 (file)
@@ -105,6 +105,7 @@ default_attributes(
       :default => {
         :repository => "https://github.com/gravitystorm/openstreetmap-carto.git",
         :revision => "v5.6.0",
+        :fonts_script => "/srv/tile.openstreetmap.org/styles/default/scripts/get-fonts.sh",
         :max_zoom => 19
       }
     }