diff --git a/.travis.yml b/.travis.yml index 83eae7c..18a38f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,8 @@ env: - VERSION=0.9.2 - VERSION=0.9.3 - VERSION=0.9.4 + - VERSION=1.0.0 + - VERSION=1.0.1 - VERSION=edge matrix: exclude: @@ -31,6 +33,8 @@ matrix: - evn: VERSION=0.9.2 TRAVIS_EVENT_TYPE=cron - evn: VERSION=0.9.3 TRAVIS_EVENT_TYPE=cron - evn: VERSION=0.9.4 TRAVIS_EVENT_TYPE=cron + - evn: VERSION=1.0.0 TRAVIS_EVENT_TYPE=cron + - evn: VERSION=1.0.1 TRAVIS_EVENT_TYPE=cron allow_failures: - env: VERSION=edge diff --git a/builder/Dockerfile b/builder/Dockerfile index 9901d93..cfd716a 100644 --- a/builder/Dockerfile +++ b/builder/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.3 +FROM alpine:3.8 COPY scripts/mkimage-phan.bash / COPY scripts/docker-entrypoint.sh / RUN apk --no-cache add bash diff --git a/builder/scripts/mkimage-phan.bash b/builder/scripts/mkimage-phan.bash index 38967a4..067b4aa 100755 --- a/builder/scripts/mkimage-phan.bash +++ b/builder/scripts/mkimage-phan.bash @@ -39,7 +39,7 @@ build() { # install runtime dependencies into rootfs { - apk --no-cache --root "$rootfs" --keys-dir /etc/apk/keys add --initdb php7 php7-json php7-sqlite3 php7-mbstring php7-pcntl php7-dom tini + apk --no-cache --root "$rootfs" --keys-dir /etc/apk/keys add --initdb php7 php7-json php7-sqlite3 php7-mbstring php7-pcntl php7-dom php7-tokenizer tini cp /docker-entrypoint.sh "$rootfs"/docker-entrypoint.sh } >&2 diff --git a/templates/test/test_cloudflare_phan.bats b/templates/test/test_cloudflare_phan.bats index bd86f07..d14be9a 100644 --- a/templates/test/test_cloudflare_phan.bats +++ b/templates/test/test_cloudflare_phan.bats @@ -24,8 +24,8 @@ setup() { [ $status -eq 1 ] [ ${#lines[@]} -eq 2 ] - [ "${lines[0]}" = "./undefined_class.php:3 PhanUndeclaredClassMethod Call to method __construct from undeclared class \Stub" ] - [ "${lines[1]}" = "./undefined_class.php:4 PhanUndeclaredClassConstant Reference to constant TYPE_STRING from undeclared class \Stub" ] + [ "${lines[0]}" = "undefined_class.php:3 PhanUndeclaredClassMethod Call to method __construct from undeclared class \Stub" ] + [ "${lines[1]}" = "undefined_class.php:4 PhanUndeclaredClassConstant Reference to constant TYPE_STRING from undeclared class \Stub" ] } @test "checkstyle output format is available" { diff --git a/templates/versions/Dockerfile b/templates/versions/Dockerfile index 9812793..471344e 100644 --- a/templates/versions/Dockerfile +++ b/templates/versions/Dockerfile @@ -1,3 +1,3 @@ -FROM alpine:3.3 +FROM alpine:3.8 ADD rootfs.tar.gz / ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"] diff --git a/test/test_cloudflare_phan-1.0.0.bats b/test/test_cloudflare_phan-1.0.0.bats new file mode 100644 index 0000000..a3ba132 --- /dev/null +++ b/test/test_cloudflare_phan-1.0.0.bats @@ -0,0 +1,36 @@ +setup() { + VERSION=1.0.0 + docker history "cloudflare/phan:${VERSION}" >/dev/null 2>&1 +} + +@test "pass arguments to phan" { + run docker run -v $PWD/test/fixtures/pass:/mnt/src "cloudflare/phan:${VERSION}" -h + [ $status -eq 0 ] + [ "${lines[0]}" = "Usage: /opt/phan/phan [options] [files...]" ] +} + +@test "outputs zero lines if source has no issues" { + run docker run -v $PWD/test/fixtures/pass:/mnt/src "cloudflare/phan:${VERSION}" \ + -l . + [ $status -eq 0 ] + [ ${#lines[@]} -eq 0 ] +} + +@test "outputs lines if source has issues" { + run docker run -v $PWD/test/fixtures/fail:/mnt/src "cloudflare/phan:${VERSION}" \ + -l . + + # even if there's failures, phan reports 1 + [ $status -eq 1 ] + + [ ${#lines[@]} -eq 2 ] + [ "${lines[0]}" = "undefined_class.php:3 PhanUndeclaredClassMethod Call to method __construct from undeclared class \Stub" ] + [ "${lines[1]}" = "undefined_class.php:4 PhanUndeclaredClassConstant Reference to constant TYPE_STRING from undeclared class \Stub" ] +} + +@test "checkstyle output format is available" { + run docker run -v $PWD/test/fixtures/pass:/mnt/src "cloudflare/phan:${VERSION}" \ + --output-mode checkstyle -l . + [ $status -eq 0 ] + [ ${#lines[@]} -eq 2 ] +} diff --git a/test/test_cloudflare_phan-1.0.1.bats b/test/test_cloudflare_phan-1.0.1.bats new file mode 100644 index 0000000..07aa63e --- /dev/null +++ b/test/test_cloudflare_phan-1.0.1.bats @@ -0,0 +1,36 @@ +setup() { + VERSION=1.0.1 + docker history "cloudflare/phan:${VERSION}" >/dev/null 2>&1 +} + +@test "pass arguments to phan" { + run docker run -v $PWD/test/fixtures/pass:/mnt/src "cloudflare/phan:${VERSION}" -h + [ $status -eq 0 ] + [ "${lines[0]}" = "Usage: /opt/phan/phan [options] [files...]" ] +} + +@test "outputs zero lines if source has no issues" { + run docker run -v $PWD/test/fixtures/pass:/mnt/src "cloudflare/phan:${VERSION}" \ + -l . + [ $status -eq 0 ] + [ ${#lines[@]} -eq 0 ] +} + +@test "outputs lines if source has issues" { + run docker run -v $PWD/test/fixtures/fail:/mnt/src "cloudflare/phan:${VERSION}" \ + -l . + + # even if there's failures, phan reports 1 + [ $status -eq 1 ] + + [ ${#lines[@]} -eq 2 ] + [ "${lines[0]}" = "undefined_class.php:3 PhanUndeclaredClassMethod Call to method __construct from undeclared class \Stub" ] + [ "${lines[1]}" = "undefined_class.php:4 PhanUndeclaredClassConstant Reference to constant TYPE_STRING from undeclared class \Stub" ] +} + +@test "checkstyle output format is available" { + run docker run -v $PWD/test/fixtures/pass:/mnt/src "cloudflare/phan:${VERSION}" \ + --output-mode checkstyle -l . + [ $status -eq 0 ] + [ ${#lines[@]} -eq 2 ] +} diff --git a/test/test_cloudflare_phan-1.0.2.bats b/test/test_cloudflare_phan-1.0.2.bats new file mode 100644 index 0000000..c43d7ea --- /dev/null +++ b/test/test_cloudflare_phan-1.0.2.bats @@ -0,0 +1,36 @@ +setup() { + VERSION=1.0.2 + docker history "cloudflare/phan:${VERSION}" >/dev/null 2>&1 +} + +@test "pass arguments to phan" { + run docker run -v $PWD/test/fixtures/pass:/mnt/src "cloudflare/phan:${VERSION}" -h + [ $status -eq 0 ] + [ "${lines[0]}" = "Usage: /opt/phan/phan [options] [files...]" ] +} + +@test "outputs zero lines if source has no issues" { + run docker run -v $PWD/test/fixtures/pass:/mnt/src "cloudflare/phan:${VERSION}" \ + -l . + [ $status -eq 0 ] + [ ${#lines[@]} -eq 0 ] +} + +@test "outputs lines if source has issues" { + run docker run -v $PWD/test/fixtures/fail:/mnt/src "cloudflare/phan:${VERSION}" \ + -l . + + # even if there's failures, phan reports 1 + [ $status -eq 1 ] + + [ ${#lines[@]} -eq 2 ] + [ "${lines[0]}" = "undefined_class.php:3 PhanUndeclaredClassMethod Call to method __construct from undeclared class \Stub" ] + [ "${lines[1]}" = "undefined_class.php:4 PhanUndeclaredClassConstant Reference to constant TYPE_STRING from undeclared class \Stub" ] +} + +@test "checkstyle output format is available" { + run docker run -v $PWD/test/fixtures/pass:/mnt/src "cloudflare/phan:${VERSION}" \ + --output-mode checkstyle -l . + [ $status -eq 0 ] + [ ${#lines[@]} -eq 2 ] +} diff --git a/test/test_cloudflare_phan-1.0.3.bats b/test/test_cloudflare_phan-1.0.3.bats new file mode 100644 index 0000000..d6395ea --- /dev/null +++ b/test/test_cloudflare_phan-1.0.3.bats @@ -0,0 +1,36 @@ +setup() { + VERSION=1.0.3 + docker history "cloudflare/phan:${VERSION}" >/dev/null 2>&1 +} + +@test "pass arguments to phan" { + run docker run -v $PWD/test/fixtures/pass:/mnt/src "cloudflare/phan:${VERSION}" -h + [ $status -eq 0 ] + [ "${lines[0]}" = "Usage: /opt/phan/phan [options] [files...]" ] +} + +@test "outputs zero lines if source has no issues" { + run docker run -v $PWD/test/fixtures/pass:/mnt/src "cloudflare/phan:${VERSION}" \ + -l . + [ $status -eq 0 ] + [ ${#lines[@]} -eq 0 ] +} + +@test "outputs lines if source has issues" { + run docker run -v $PWD/test/fixtures/fail:/mnt/src "cloudflare/phan:${VERSION}" \ + -l . + + # even if there's failures, phan reports 1 + [ $status -eq 1 ] + + [ ${#lines[@]} -eq 2 ] + [ "${lines[0]}" = "undefined_class.php:3 PhanUndeclaredClassMethod Call to method __construct from undeclared class \Stub" ] + [ "${lines[1]}" = "undefined_class.php:4 PhanUndeclaredClassConstant Reference to constant TYPE_STRING from undeclared class \Stub" ] +} + +@test "checkstyle output format is available" { + run docker run -v $PWD/test/fixtures/pass:/mnt/src "cloudflare/phan:${VERSION}" \ + --output-mode checkstyle -l . + [ $status -eq 0 ] + [ ${#lines[@]} -eq 2 ] +} diff --git a/test/test_cloudflare_phan-1.0.4.bats b/test/test_cloudflare_phan-1.0.4.bats new file mode 100644 index 0000000..ad35f7d --- /dev/null +++ b/test/test_cloudflare_phan-1.0.4.bats @@ -0,0 +1,36 @@ +setup() { + VERSION=1.0.4 + docker history "cloudflare/phan:${VERSION}" >/dev/null 2>&1 +} + +@test "pass arguments to phan" { + run docker run -v $PWD/test/fixtures/pass:/mnt/src "cloudflare/phan:${VERSION}" -h + [ $status -eq 0 ] + [ "${lines[0]}" = "Usage: /opt/phan/phan [options] [files...]" ] +} + +@test "outputs zero lines if source has no issues" { + run docker run -v $PWD/test/fixtures/pass:/mnt/src "cloudflare/phan:${VERSION}" \ + -l . + [ $status -eq 0 ] + [ ${#lines[@]} -eq 0 ] +} + +@test "outputs lines if source has issues" { + run docker run -v $PWD/test/fixtures/fail:/mnt/src "cloudflare/phan:${VERSION}" \ + -l . + + # even if there's failures, phan reports 1 + [ $status -eq 1 ] + + [ ${#lines[@]} -eq 2 ] + [ "${lines[0]}" = "undefined_class.php:3 PhanUndeclaredClassMethod Call to method __construct from undeclared class \Stub" ] + [ "${lines[1]}" = "undefined_class.php:4 PhanUndeclaredClassConstant Reference to constant TYPE_STRING from undeclared class \Stub" ] +} + +@test "checkstyle output format is available" { + run docker run -v $PWD/test/fixtures/pass:/mnt/src "cloudflare/phan:${VERSION}" \ + --output-mode checkstyle -l . + [ $status -eq 0 ] + [ ${#lines[@]} -eq 2 ] +} diff --git a/test/test_cloudflare_phan-edge.bats b/test/test_cloudflare_phan-edge.bats index 6d98751..2908d1c 100644 --- a/test/test_cloudflare_phan-edge.bats +++ b/test/test_cloudflare_phan-edge.bats @@ -25,8 +25,8 @@ setup() { [ $status -eq 1 ] [ ${#lines[@]} -eq 2 ] - [ "${lines[0]}" = "./undefined_class.php:3 PhanUndeclaredClassMethod Call to method __construct from undeclared class \Stub" ] - [ "${lines[1]}" = "./undefined_class.php:4 PhanUndeclaredClassConstant Reference to constant TYPE_STRING from undeclared class \Stub" ] + [ "${lines[0]}" = "undefined_class.php:3 PhanUndeclaredClassMethod Call to method __construct from undeclared class \Stub" ] + [ "${lines[1]}" = "undefined_class.php:4 PhanUndeclaredClassConstant Reference to constant TYPE_STRING from undeclared class \Stub" ] } @test "checkstyle output format is available" { diff --git a/versions/1.0.0/Dockerfile b/versions/1.0.0/Dockerfile new file mode 100644 index 0000000..471344e --- /dev/null +++ b/versions/1.0.0/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine:3.8 +ADD rootfs.tar.gz / +ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"] diff --git a/versions/1.0.0/options b/versions/1.0.0/options new file mode 100644 index 0000000..6f5d111 --- /dev/null +++ b/versions/1.0.0/options @@ -0,0 +1,5 @@ +export RELEASE="1.0.0" +export MIRROR="http://mirror.sfo12.us.leaseweb.net/alpine" +export AST="0.1.6" +export BUILD_OPTIONS=(-s -r $RELEASE -m $MIRROR -a $AST) +export TAGS=(cloudflare/phan:1.0.0) diff --git a/versions/1.0.1/Dockerfile b/versions/1.0.1/Dockerfile new file mode 100644 index 0000000..471344e --- /dev/null +++ b/versions/1.0.1/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine:3.8 +ADD rootfs.tar.gz / +ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"] diff --git a/versions/1.0.1/options b/versions/1.0.1/options new file mode 100644 index 0000000..e1636e6 --- /dev/null +++ b/versions/1.0.1/options @@ -0,0 +1,5 @@ +export RELEASE="1.0.1" +export MIRROR="http://mirror.sfo12.us.leaseweb.net/alpine" +export AST="0.1.6" +export BUILD_OPTIONS=(-s -r $RELEASE -m $MIRROR -a $AST) +export TAGS=(cloudflare/phan:1.0.1) diff --git a/versions/1.0.2/Dockerfile b/versions/1.0.2/Dockerfile new file mode 100644 index 0000000..471344e --- /dev/null +++ b/versions/1.0.2/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine:3.8 +ADD rootfs.tar.gz / +ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"] diff --git a/versions/1.0.2/options b/versions/1.0.2/options new file mode 100644 index 0000000..ba4308a --- /dev/null +++ b/versions/1.0.2/options @@ -0,0 +1,5 @@ +export RELEASE="1.0.2" +export MIRROR="http://mirror.sfo12.us.leaseweb.net/alpine" +export AST="0.1.6" +export BUILD_OPTIONS=(-s -r $RELEASE -m $MIRROR -a $AST) +export TAGS=(cloudflare/phan:1.0.2) diff --git a/versions/1.0.3/Dockerfile b/versions/1.0.3/Dockerfile new file mode 100644 index 0000000..471344e --- /dev/null +++ b/versions/1.0.3/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine:3.8 +ADD rootfs.tar.gz / +ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"] diff --git a/versions/1.0.3/options b/versions/1.0.3/options new file mode 100644 index 0000000..ca90ae7 --- /dev/null +++ b/versions/1.0.3/options @@ -0,0 +1,5 @@ +export RELEASE="1.0.3" +export MIRROR="http://mirror.sfo12.us.leaseweb.net/alpine" +export AST="0.1.6" +export BUILD_OPTIONS=(-s -r $RELEASE -m $MIRROR -a $AST) +export TAGS=(cloudflare/phan:1.0.3) diff --git a/versions/1.0.4/Dockerfile b/versions/1.0.4/Dockerfile new file mode 100644 index 0000000..471344e --- /dev/null +++ b/versions/1.0.4/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine:3.8 +ADD rootfs.tar.gz / +ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"] diff --git a/versions/1.0.4/options b/versions/1.0.4/options new file mode 100644 index 0000000..ccb0b6b --- /dev/null +++ b/versions/1.0.4/options @@ -0,0 +1,5 @@ +export RELEASE="1.0.4" +export MIRROR="http://mirror.sfo12.us.leaseweb.net/alpine" +export AST="0.1.6" +export BUILD_OPTIONS=(-s -r $RELEASE -m $MIRROR -a $AST) +export TAGS=(cloudflare/phan:1.0.4)