Skip to content

Commit

Permalink
FIX caliper-php lib can't be installed
Browse files Browse the repository at this point in the history
The caliper-php repo went private. So I've switched the source to an
archive.

Found out that you can merge in extension composer.json instead of
duplicating it in composer.local.json, so I changed it to pull in the
caliper-php lib via the caliper extension's composer.json.

I tried merging in all extension composer.json, but it didn't work,
there was a conflict with the mediawiki/maps package, open issue here:
ProfessionalWiki/Maps#745

If it weren't for that, we could use the mediawiki suggested:

{
    "extra": {
        "merge-plugin": {
            "include": [
                "extensions/*/composer.json",
                "skins/*/composer.json"
            ]
        }
    }
}

Which pulls in all extension/skin dependencies automatically.
  • Loading branch information
ionparticle committed Jun 28, 2023
1 parent 9478c77 commit 8bc27ba
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ COPY composer.local.json /var/www/html/composer.local.json
COPY robots.txt /var/www/html/robots.txt
#COPY ParsoidHandler_custom_1_35.php /var/www/html/vendor/wikimedia/parsoid/extension/src/Rest/Handler/ParsoidHandler.php

# composer won't load plugins if we don't explicitly allow executing as root
ENV COMPOSER_ALLOW_SUPERUSER=1
# FIXME temp hack to use lastest composer 1.x. composer 2.x version will break wikimedia/composer-merge-plugin
RUN curl -L https://getcomposer.org/installer | php \
#RUN curl -L https://getcomposer.org/composer-1.phar --output composer.phar \
Expand All @@ -86,9 +88,9 @@ RUN EXTS=`curl https://extdist.wmflabs.org/dist/extensions/ | awk 'BEGIN { FS =
&& echo "Installing https://github.com/SkizNet/mediawiki-GTag/archive/master.tar.gz" \
&& mkdir -p /var/www/html/extensions/GTag \
&& curl -Ls https://github.com/SkizNet/mediawiki-GTag/archive/master.tar.gz | tar xz --strip=1 -C /var/www/html/extensions/GTag\
&& echo "Installing https://github.com/ubc/mediawiki-extensions-caliper/archive/v2.0.3.tar.gz" \
&& echo "Installing https://github.com/ubc/mediawiki-extensions-caliper/archive/v2.0.4.tar.gz" \
&& mkdir -p /var/www/html/extensions/caliper \
&& curl -Ls https://github.com/ubc/mediawiki-extensions-caliper/archive/v2.0.3.tar.gz | tar xz --strip=1 -C /var/www/html/extensions/caliper \
&& curl -Ls https://github.com/ubc/mediawiki-extensions-caliper/archive/v2.0.4.tar.gz | tar xz --strip=1 -C /var/www/html/extensions/caliper \
&& echo "Installing https://github.com/ubc/mediawiki-extensions-ubcauth/archive/master.tar.gz" \
&& mkdir -p /var/www/html/extensions/UBCAuth\
&& curl -Ls https://github.com/ubc/mediawiki-extensions-ubcauth/archive/master.tar.gz | tar xz --strip=1 -C /var/www/html/extensions/UBCAuth \
Expand All @@ -102,6 +104,9 @@ RUN EXTS=`curl https://extdist.wmflabs.org/dist/extensions/ | awk 'BEGIN { FS =
#&& mkdir -p /var/www/html/extensions/Math \
#&& curl -Ls https://github.com/ubc/mediawiki-extensions-Math/archive/REL1_35.tar.gz | tar xz --strip=1 -C /var/www/html/extensions/Math

# composer.local.json merges in composer.json from caliper extension, so we
# need to run composer update after getting the extensions.
RUN php composer.phar update --no-dev

RUN mkdir -p /data \
&& chmod a+x /var/www/html/extensions/Scribunto/includes/engines/LuaStandalone/binaries/lua5_1_5_linux_64_generic/lua \
Expand Down
16 changes: 8 additions & 8 deletions composer.local.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"minimum-stability": "stable",
"repositories": [
{
"type": "git",
"url": "https://github.com/IMSGlobal/caliper-php"
}
],
"require": {
"mediawiki/maps": "~10.0",
"pear/mail_mime-decode": "1.5.5.2",
"google/apiclient":"^2.2",
"imsglobal/caliper": "develop#c7e34e230abc7bbb647f8f94245cb649f6191bcd as 1.2.0"
"google/apiclient":"^2.2"
},
"extra": {
"merge-plugin": {
"include": [
"extensions/caliper/composer.json"
]
}
}
}
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2'
services:
db:
image: mariadb:10.4
image: mariadb:10.6
environment:
- MYSQL_ROOT_PASSWORD=password
volumes:
Expand Down

0 comments on commit 8bc27ba

Please sign in to comment.