Skip to content
This repository was archived by the owner on Oct 14, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts/mkimage-phan.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions templates/test/test_cloudflare_phan.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
2 changes: 1 addition & 1 deletion templates/versions/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM alpine:3.3
FROM alpine:3.8
ADD rootfs.tar.gz /
ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"]
36 changes: 36 additions & 0 deletions test/test_cloudflare_phan-1.0.0.bats
Original file line number Diff line number Diff line change
@@ -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 ]
}
36 changes: 36 additions & 0 deletions test/test_cloudflare_phan-1.0.1.bats
Original file line number Diff line number Diff line change
@@ -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 ]
}
36 changes: 36 additions & 0 deletions test/test_cloudflare_phan-1.0.2.bats
Original file line number Diff line number Diff line change
@@ -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 ]
}
36 changes: 36 additions & 0 deletions test/test_cloudflare_phan-1.0.3.bats
Original file line number Diff line number Diff line change
@@ -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 ]
}
36 changes: 36 additions & 0 deletions test/test_cloudflare_phan-1.0.4.bats
Original file line number Diff line number Diff line change
@@ -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 ]
}
4 changes: 2 additions & 2 deletions test/test_cloudflare_phan-edge.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
3 changes: 3 additions & 0 deletions versions/1.0.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alpine:3.8
ADD rootfs.tar.gz /
ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"]
5 changes: 5 additions & 0 deletions versions/1.0.0/options
Original file line number Diff line number Diff line change
@@ -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)
3 changes: 3 additions & 0 deletions versions/1.0.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alpine:3.8
ADD rootfs.tar.gz /
ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"]
5 changes: 5 additions & 0 deletions versions/1.0.1/options
Original file line number Diff line number Diff line change
@@ -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)
3 changes: 3 additions & 0 deletions versions/1.0.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alpine:3.8
ADD rootfs.tar.gz /
ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"]
5 changes: 5 additions & 0 deletions versions/1.0.2/options
Original file line number Diff line number Diff line change
@@ -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)
3 changes: 3 additions & 0 deletions versions/1.0.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alpine:3.8
ADD rootfs.tar.gz /
ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"]
5 changes: 5 additions & 0 deletions versions/1.0.3/options
Original file line number Diff line number Diff line change
@@ -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)
3 changes: 3 additions & 0 deletions versions/1.0.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alpine:3.8
ADD rootfs.tar.gz /
ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"]
5 changes: 5 additions & 0 deletions versions/1.0.4/options
Original file line number Diff line number Diff line change
@@ -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)