From 647c3003e35fe19d949e1d78c4bb6f2c526e6bad Mon Sep 17 00:00:00 2001 From: Michael Glanznig Date: Sun, 14 Jan 2018 10:03:24 +0100 Subject: [PATCH] Add new skin to OSMF mediawiki instance Closes #141 --- cookbooks/foundation/recipes/wiki.rb | 7 +++++++ cookbooks/mediawiki/resources/skin.rb | 13 ++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/cookbooks/foundation/recipes/wiki.rb b/cookbooks/foundation/recipes/wiki.rb index 2baa6c7f7..bb86254f1 100644 --- a/cookbooks/foundation/recipes/wiki.rb +++ b/cookbooks/foundation/recipes/wiki.rb @@ -48,6 +48,13 @@ mediawiki_skin "osmf" do revision "master" end +mediawiki_skin "OSMFoundation" do + site "wiki.osmfoundation.org" + repository "git://github.com/osmfoundation/osmf-mediawiki-skin.git" + revision "master" + legacy false +end + cookbook_file "/srv/wiki.osmfoundation.org/Wiki.png" do owner node[:mediawiki][:user] group node[:mediawiki][:group] diff --git a/cookbooks/mediawiki/resources/skin.rb b/cookbooks/mediawiki/resources/skin.rb index 1f897c53b..9b1324895 100644 --- a/cookbooks/mediawiki/resources/skin.rb +++ b/cookbooks/mediawiki/resources/skin.rb @@ -28,6 +28,7 @@ property :version, :kind_of => String property :repository, :kind_of => String property :revision, :kind_of => String property :update_site, :kind_of => [TrueClass, FalseClass], :default => true +property :legacy, :kind_of => [TrueClass, FalseClass], :default => true action :create do if new_resource.source @@ -66,14 +67,20 @@ action :create do variables new_resource.variables end else - skin_script = "#{skin_directory}/#{new_resource.skin}.php" + if new_resource.legacy + file_content = "