build: add run
file
This commit is contained in:
parent
231e7dc9cd
commit
c25104c321
2 changed files with 31 additions and 1 deletions
|
@ -6,7 +6,8 @@ ENV PATH="${PATH}:/app/vendor/bin"
|
|||
|
||||
WORKDIR /app
|
||||
|
||||
RUN adduser --disabled-password app \
|
||||
RUN apk add --no-cache bash \
|
||||
&& adduser --disabled-password app \
|
||||
&& chown app:app -R /app
|
||||
|
||||
USER app
|
||||
|
|
29
run
Executable file
29
run
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Based on https://github.com/adriancooney/Taskfile and
|
||||
# https://nickjanetakis.com/blog/replacing-make-with-a-shell-script-for-running-your-projects-tasks.
|
||||
|
||||
DOCKER_TAG=meetup-raffle-winner-picker
|
||||
|
||||
function build {
|
||||
# Build the Docker image.
|
||||
docker image build . --tag ${DOCKER_TAG}
|
||||
}
|
||||
|
||||
function help {
|
||||
printf "%s <task> [args]\n\nTasks:\n" "${0}"
|
||||
|
||||
compgen -A function | grep -v "^_" | cat -n
|
||||
|
||||
printf "\nExtended help:\n Each task has comments for general usage\n"
|
||||
}
|
||||
|
||||
function test {
|
||||
# Run PHPUnit tests.
|
||||
docker container run --rm -it \
|
||||
-v $(pwd):/app \
|
||||
--entrypoint phpunit \
|
||||
${DOCKER_TAG} "${@}"
|
||||
}
|
||||
|
||||
eval "${@:-help}"
|
Loading…
Add table
Add a link
Reference in a new issue