Add Dockerfile for unit tests.

This commit is contained in:
Daniel Kraus
2019-03-12 13:24:11 +01:00
parent 541e79d5c5
commit a3dff9f172
3 changed files with 30 additions and 0 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
.git

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
# This Dockerfile can be used to create a Docker image/container
# that runs the unit tests on the LinkTitles extension.
FROM mediawiki:1.32
MAINTAINER Daniel Kraus (https://www.bovender.de)
RUN apt update -yqq && \
apt install -yqq \
php7.0-sqlite \
sqlite3 \
unzip \
zip
RUN curl https://raw.githubusercontent.com/composer/getcomposer.org/cb19f2aa3aeaa2006c0cd69a7ef011eb31463067/web/installer -s | php -- --quiet
RUN php composer.phar install
COPY . /var/www/html/extensions/LinkTitles/
RUN mkdir /data && chown www-data /data
WORKDIR /var/www/html/maintenance
RUN php install.php --pass admin --dbtype sqlite --extensions LinkTitles Tests admin
WORKDIR /var/www/html/tests/phpunit
CMD ["php", "phpunit.php", "--group", "bovender"]

7
Makefile Normal file
View File

@ -0,0 +1,7 @@
.PHONY: test
test:
docker run -it --rm bovender/linktitles
build-test-container:
docker build -t bovender/linktitles .