build(run): fix test
command
This commit is contained in:
parent
6ebdc9c6f6
commit
1334db0d83
15
run
15
run
|
@ -3,6 +3,9 @@
|
||||||
# Based on https://github.com/adriancooney/Taskfile and
|
# Based on https://github.com/adriancooney/Taskfile and
|
||||||
# https://nickjanetakis.com/blog/replacing-make-with-a-shell-script-for-running-your-projects-tasks.
|
# https://nickjanetakis.com/blog/replacing-make-with-a-shell-script-for-running-your-projects-tasks.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
APP_BUILD="${APP_BUILD:=dynamic}"
|
||||||
DOCKER_TAG=meetup-raffle-winner-picker
|
DOCKER_TAG=meetup-raffle-winner-picker
|
||||||
|
|
||||||
function build {
|
function build {
|
||||||
|
@ -11,6 +14,9 @@ function build {
|
||||||
}
|
}
|
||||||
|
|
||||||
function ci:test {
|
function ci:test {
|
||||||
|
# Run continuous integration (CI) checks.
|
||||||
|
APP_BUILD=static
|
||||||
|
|
||||||
build
|
build
|
||||||
test "${@}"
|
test "${@}"
|
||||||
}
|
}
|
||||||
|
@ -33,10 +39,11 @@ function help {
|
||||||
|
|
||||||
function test {
|
function test {
|
||||||
# Run PHPUnit tests.
|
# Run PHPUnit tests.
|
||||||
docker container run --rm -t \
|
if [[ $APP_BUILD == "dynamic" ]]; then
|
||||||
-v $(pwd):/app \
|
docker container run --rm -t -v $PWD:/app --entrypoint phpunit ${DOCKER_TAG} "${@}"
|
||||||
--entrypoint phpunit \
|
elif [[ $APP_BUILD == "static" ]]; then
|
||||||
${DOCKER_TAG} "${@}"
|
docker container run --rm -t --entrypoint phpunit ${DOCKER_TAG} "${@}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
eval "${@:-help}"
|
eval "${@:-help}"
|
||||||
|
|
Loading…
Reference in a new issue