From: Tom Hughes Date: Fri, 6 Jul 2018 18:04:11 +0000 (+0100) Subject: Run composer for mediawiki extensions that need it X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/900cc4d0e89348d1396fc3dc38d131e486c2914c Run composer for mediawiki extensions that need it --- diff --git a/cookbooks/mediawiki/resources/extension.rb b/cookbooks/mediawiki/resources/extension.rb index 6dc79ea7e..47e807052 100644 --- a/cookbooks/mediawiki/resources/extension.rb +++ b/cookbooks/mediawiki/resources/extension.rb @@ -28,6 +28,7 @@ property :version, :kind_of => String property :repository, :kind_of => String property :tag, :kind_of => String property :reference, :kind_of => String +property :compose, :kind_of => [TrueClass, FalseClass], :default => false property :update_site, :kind_of => [TrueClass, FalseClass], :default => true action :create do @@ -83,6 +84,17 @@ action :create do only_if { ::File.exist?(extension_script) } end end + + if new_resource.compose # ~FC023 + execute "composer-#{new_resource.extension}" do + action :nothing + command "composer install --no-dev" + cwd extension_directory + user node[:mediawiki][:user] + group node[:mediawiki][:group] + subscribes :run, "git[#{extension_directory}]" + end + end end action :delete do diff --git a/cookbooks/mediawiki/resources/site.rb b/cookbooks/mediawiki/resources/site.rb index 7dc08f6f7..5bd0feff0 100644 --- a/cookbooks/mediawiki/resources/site.rb +++ b/cookbooks/mediawiki/resources/site.rb @@ -368,12 +368,14 @@ action :create do mediawiki_extension "AntiSpoof" do site new_resource.site template "mw-ext-AntiSpoof.inc.php.erb" + compose true update_site false end mediawiki_extension "AbuseFilter" do site new_resource.site template "mw-ext-AbuseFilter.inc.php.erb" + compose true update_site false end @@ -390,6 +392,7 @@ action :create do mediawiki_extension "Elastica" do site new_resource.site + compose true update_site false end