From a3dff9f1722c0db7d5192b47688036e8e67f7402 Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Tue, 12 Mar 2019 13:24:11 +0100 Subject: [PATCH] Add Dockerfile for unit tests. --- .dockerignore | 2 ++ Dockerfile | 21 +++++++++++++++++++++ Makefile | 7 +++++++ 3 files changed, 30 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 Makefile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..d436eab --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.git + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4401cb6 --- /dev/null +++ b/Dockerfile @@ -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"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e3ed9da --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +.PHONY: test + +test: + docker run -it --rm bovender/linktitles + +build-test-container: + docker build -t bovender/linktitles .