X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/1b2a50a03b5beaf0d4f2e126bee875b6f66fc1bd..143c921e6c8994f507cbdd06c19a5daee718731b:/cookbooks/mediawiki/providers/site.rb?ds=sidebyside diff --git a/cookbooks/mediawiki/providers/site.rb b/cookbooks/mediawiki/providers/site.rb index 29f0c9ecf..0a72b203d 100644 --- a/cookbooks/mediawiki/providers/site.rb +++ b/cookbooks/mediawiki/providers/site.rb @@ -85,13 +85,12 @@ action :create do mode 0775 end - mediawiki_reference = "refs/heads/REL#{new_resource.version}".tr(".", "_") + mediawiki_reference = "REL#{new_resource.version}".tr(".", "_") - git site_directory do + git mediawiki_directory do action :sync - repository "git://github.com/wikimedia/mediawiki-core" - reference mediawiki_reference - # depth 1 + repository "https://gerrit.wikimedia.org/r/p/mediawiki/core.git" + revision mediawiki_reference user node[:mediawiki][:user] group node[:mediawiki][:group] notifies :run, "execute[#{mediawiki_directory}/maintenance/install.php]", :immediately @@ -161,6 +160,26 @@ action :create do :database_params => new_resource.database_params end + mediawiki_skin "CologneBlue" do # ~FC005 + site new_resource.name + update_site false + end + + mediawiki_skin "Modern" do + site new_resource.name + update_site false + end + + mediawiki_skin "MonoBook" do + site new_resource.name + update_site false + end + + mediawiki_skin "Vector" do + site new_resource.name + update_site false + end + mediawiki_extension "Cite" do site new_resource.name template "mw-ext-Cite.inc.php.erb" @@ -251,7 +270,7 @@ action :create do # MediaWiki Language Extension Bundle # FIXME: should automatically resolve tag - mw_lang_ext_bundle_tag = "2014.09" + mw_lang_ext_bundle_tag = "2015.08" mediawiki_extension "Babel" do site new_resource.name @@ -357,6 +376,23 @@ action :create do update_site false end + mediawiki_extension "Mantle" do + site new_resource.name + update_site false + end + + mediawiki_extension "MobileFrontend" do + site new_resource.name + template "mw-ext-MobileFrontend.inc.php.erb" + update_site false + end + + mediawiki_extension "DisableAccount" do + site new_resource.name + template "mw-ext-DisableAccount.inc.php.erb" + update_site false + end + cookbook_file "#{site_directory}/cc-wiki.png" do cookbook "mediawiki" owner node[:mediawiki][:user] @@ -381,13 +417,15 @@ action :create do backup false end + ports = new_resource.ssl_enabled ? [80, 443] : [80] + apache_site new_resource.name do cookbook "mediawiki" template "apache.erb" directory site_directory variables :aliases => Array(new_resource.aliases), :private => new_resource.private, - :ssl_enabled => new_resource.ssl_enabled, + :ports => ports, :ssl_certificate => new_resource.ssl_certificate, :ssl_certificate_chain => new_resource.ssl_certificate_chain reload_apache false @@ -403,6 +441,31 @@ action :create do end end +action :update do + mediawiki_directory = "#{site_directory}/w" + + template "#{mediawiki_directory}/LocalSettings.php" do + cookbook "mediawiki" + source "LocalSettings.php.erb" + owner node[:mediawiki][:user] + group node[:mediawiki][:group] + mode 0664 + variables :name => new_resource.name, + :directory => mediawiki_directory, + :database_params => new_resource.database_params, + :mediawiki => new_resource.mediawiki_params + notifies :run, "execute[#{mediawiki_directory}/maintenance/update.php]" + end + + execute "#{mediawiki_directory}/maintenance/update.php" do + action :run + command "php maintenance/update.php --quick" + cwd mediawiki_directory + user node[:mediawiki][:user] + group node[:mediawiki][:group] + end +end + action :delete do apache_site new_resource.name do action :delete