diff --git a/Dockerfile b/Dockerfile index f2a30e65..f9de54bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -103,30 +103,10 @@ RUN set -x; \ # Skins # The Minerva Neue, MonoBook, Timeless, Vector and Vector 2022 skins are bundled into MediaWiki and do not need to be # separately installed. -RUN set -x; \ - cd $MW_HOME/skins \ - # Chameleon (v. 4.2.1) - && git clone https://github.com/ProfessionalWiki/chameleon $MW_HOME/skins/chameleon \ - && cd $MW_HOME/skins/chameleon \ - && git checkout -q f34a56528ada14ac07e1b03beda41f775ef27606 \ - # CologneBlue - && git clone -b $MW_VERSION --single-branch https://github.com/wikimedia/mediawiki-skins-CologneBlue $MW_HOME/skins/CologneBlue \ - && cd $MW_HOME/skins/CologneBlue \ - && git checkout -q 4d588eb78d7e64e574f631c5897579537305437d \ - # Modern - && git clone -b $MW_VERSION --single-branch https://github.com/wikimedia/mediawiki-skins-Modern $MW_HOME/skins/Modern \ - && cd $MW_HOME/skins/Modern \ - && git checkout -q fb6c2831b5f150e9b82d98d661710695a2d0f8f2 \ - # Pivot - && git clone -b v2.3.0 https://github.com/wikimedia/mediawiki-skins-Pivot $MW_HOME/skins/pivot \ - && cd $MW_HOME/skins/pivot \ - && git checkout -q d79af7514347eb5272936243d4013118354c85c1 \ - # Refreshed - && git clone -b $MW_VERSION --single-branch https://github.com/wikimedia/mediawiki-skins-Refreshed $MW_HOME/skins/Refreshed \ - && cd $MW_HOME/skins/Refreshed \ - && git checkout -q 86f33620f25335eb62289aa18d342ff3b980d8b8 - +COPY _sources/scripts/extensions-skins.php /tmp/extensions-skins.php COPY _sources/patches/* /tmp/ +COPY _sources/configs/skins.yaml /tmp/skins.yaml +RUN php /tmp/extensions-skins.php "skins" "/tmp/skins.yaml" # Extensions # The following extensions are bundled into MediaWiki and do not need to be separately installed: @@ -136,16 +116,8 @@ COPY _sources/patches/* /tmp/ # VisualEditor, WikiEditor. # The following extensions are downloaded via Composer and also do not need to be downloaded here: # Bootstrap, DataValues (and related extensions like DataValuesCommon), ParserHooks. -COPY _sources/scripts/extension-setup.sh /tmp/extension-setup.sh COPY _sources/configs/extensions.yaml /tmp/extensions.yaml -RUN wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -RUN chmod a+x /usr/local/bin/yq -RUN set -x; \ - apt-get update \ - && apt-get install -y jq \ - && chmod +x /tmp/extension-setup.sh - -RUN /tmp/extension-setup.sh +RUN php /tmp/extensions-skins.php "extensions" "/tmp/extensions.yaml" # Patch composer RUN set -x; \ diff --git a/_sources/configs/skins.yaml b/_sources/configs/skins.yaml new file mode 100644 index 00000000..d7a76703 --- /dev/null +++ b/_sources/configs/skins.yaml @@ -0,0 +1,17 @@ +# Canasta YAML file for skins for MediaWiki 1.39. +# Where the repository is not specified, the Wikimedia Git repository for the +# skins with that name is used, and the default branch used is REL1_39. +# Where the repository *is* specified, the default branch used is master. +skins: + - Chameleon: + commit: f34a56528ada14ac07e1b03beda41f775ef27606 # v. 4.2.1 + repository: https://github.com/ProfessionalWiki/chameleon + - CologneBlue: + commit: 4d588eb78d7e64e574f631c5897579537305437d + - Modern: + commit: fb6c2831b5f150e9b82d98d661710695a2d0f8f2 + - Pivot: + branch: v2.3.0 + commit: d79af7514347eb5272936243d4013118354c85c1 + - Refreshed: + commit: 86f33620f25335eb62289aa18d342ff3b980d8b8 \ No newline at end of file diff --git a/_sources/scripts/extension-setup.sh b/_sources/scripts/extension-setup.sh deleted file mode 100644 index e8671423..00000000 --- a/_sources/scripts/extension-setup.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -MW_HOME="$MW_HOME" -MW_VERSION="$MW_VERSION" -# Since yq cannot process data from variables, a conversion is made to JSON format to utilise jq. -commands=$(yq eval '. | to_json' /tmp/extensions.yaml) -echo "$commands" | jq -r '.extensions' | jq -c '.[]' | while read -r obj; do - extension_data=$(echo "$obj" | jq -r 'keys_unsorted[] as $key | select(has($key)) | "\($key) \(.[$key].repository) \(.[$key].commit) \(.[$key].branch)"') - read -r extension_name repository commit branch <<< "$extension_data" - - git_clone_cmd="git clone " - if [ "$repository" == "null" ]; then - repository="https://github.com/wikimedia/mediawiki-extensions-$extension_name" - if [ "$branch" == "null" ]; then - branch=$MW_VERSION - git_clone_cmd="$git_clone_cmd --single-branch -b $branch" - fi - fi - git_clone_cmd="$git_clone_cmd $repository $MW_HOME/extensions/$extension_name" - git_checkout_cmd="cd $MW_HOME/extensions/$extension_name && git checkout -q $commit" - - eval "$git_clone_cmd && $git_checkout_cmd" - patches=$(echo "$obj" | jq -r ".$extension_name.patches") - if [ "$patches" != "null" ]; then - echo "$patches" | jq -c '.[]' | while read -r patch; do - git_apply_cmd="cd $MW_HOME/extensions/$extension_name && git apply /tmp/$patch" - eval "$git_apply_cmd" - done - fi -done diff --git a/_sources/scripts/extensions-skins.php b/_sources/scripts/extensions-skins.php new file mode 100644 index 00000000..0d57dac2 --- /dev/null +++ b/_sources/scripts/extensions-skins.php @@ -0,0 +1,47 @@ + +