-
Notifications
You must be signed in to change notification settings - Fork 0
/
harbor
executable file
·40 lines (31 loc) · 1.01 KB
/
harbor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash
# This is just the mini harbor for test and composer update
VERSION=1.0.0
export DOCKER_PHP_VERSION=${DOCKER_PHP_VERSION:-7.2}
# create base docker-compose command to run
DOCKER="docker run -it --rm -v "$(PWD)":/var/www/html:delegated -v "$(PWD)/docker/php/ssh":/root/.ssh:delegated dejwcake/php${DOCKER_PHP_VERSION:-8.0}:latest"
if [[ $# -gt 0 ]]; then
case "$1" in
# If "composer" or "comp" is used, pass to "composer" inside a container
composer|comp)
shift 1
${DOCKER} composer "$@"
;;
# If "test" is used, run unit tests, pass any extra arguments to phpunit
test)
shift 1
${DOCKER} ./vendor/bin/phpunit "$@"
;;
# Get version
-v|--version)
echo ${VERSION}
;;
# Else, pass args to docker-compose
*)
docker "$@"
;;
esac
else
# Use the docker-compose ps command if nothing else passed through
docker ps
fi