Skip to content
Permalink
Browse files

Run test suite on minimal PHP 5.6

  • Loading branch information...
apeschar committed May 2, 2018
1 parent 710fb1b commit e900f03f3808b5a12642519fb21e8c7da7c183d9
Showing with 29 additions and 14 deletions.
  1. +2 −2 .gitignore
  2. +7 −7 Makefile
  3. +4 −4 docker/entrypoint
  4. +1 −1 Dockerfile → docker/php56
  5. +15 −0 docker/php56-min
@@ -1,3 +1,3 @@
/vendor
/.docker-image-id
/dist
/docker/*.image
/vendor
@@ -1,22 +1,22 @@
RUN = docker run -it -v $(shell pwd):/data -w /data $(shell cat .docker-image-id)
PHP56 = docker run -it -v $(shell pwd):/data -w /data $(shell cat docker/php56.image)
PHP56MIN = docker run -it -v $(shell pwd):/data -w /data $(shell cat docker/php56-min.image)


.PHONY : all test test-local update docker dist


all : vendor/autoload.php

test : all docker
$(RUN) vendor/bin/phpunit
test : all docker/php56.image docker/php56-min.image
$(PHP56) vendor/bin/phpunit
$(PHP56MIN) vendor/bin/phpunit

test-local : all
vendor/bin/phpunit

update : all
vendor/composer.phar update

docker : .docker-image-id

dist : all
bin/package

@@ -30,6 +30,6 @@ vendor/composer.phar :
chmod +x $@~
mv $@~ $@

.docker-image-id : Dockerfile docker/entrypoint
docker build -q . > $@~
docker/%.image : docker/% docker/entrypoint
docker build -q -f $< docker > $@~
mv $@~ $@
@@ -1,9 +1,9 @@
#!/bin/bash
#!/bin/sh

set -euo pipefail
set -eu

if [[ -d /data ]]; then
usermod -u `stat --printf=%u /data` docker 2>&1 | grep -v '^usermod: no changes' || :
if [ -d /data ]; then
usermod -u `stat -c %u /data` docker 2>&1 | grep -v '^usermod: no changes' || :
fi

sudo -u docker "$@"
@@ -14,5 +14,5 @@ RUN apt-get update && apt-get install -y \

RUN useradd -m docker

COPY docker/entrypoint /entrypoint
COPY entrypoint /entrypoint
ENTRYPOINT ["/bin/bash", "/entrypoint"]
@@ -0,0 +1,15 @@
FROM alpine:latest

RUN apk update && \
apk add \
shadow \
sudo \
php5 \
php5-dom

RUN ln -s /usr/bin/php5 /usr/bin/php

RUN useradd -m docker

COPY entrypoint /entrypoint
ENTRYPOINT ["/bin/sh", "/entrypoint"]

0 comments on commit e900f03

Please sign in to comment.
You can’t perform that action at this time.