-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·57 lines (45 loc) · 1.07 KB
/
run.sh
File metadata and controls
executable file
·57 lines (45 loc) · 1.07 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
# Default values
EXEC=1
TESTS=0
VERBOSE=0
set -e
show_help() {
echo "Usage: $0 [-s] [-t] [-v] [-h]"
echo " -s: Run a shell instead of running the application"
echo " -t: Run tests"
echo " -v: Verbose output"
echo " -h: Show this help"
}
while getopts stvh flag
do
case "${flag}" in
s) EXEC=0;;
t) TESTS=1;;
v) VERBOSE=1;;
h) show_help; exit 0;;
*) show_help; exit 1;;
esac
done
if [ $VERBOSE -eq 1 ]; then
set -x
fi
# Build docker containers
docker compose build --pull --build-arg FIX_UID="$(id -u)" --build-arg FIX_GID="$(id -g)"
# Start docker environment
docker compose up -d
docker restart dnsdock || true
if [ $TESTS -eq 1 ]; then
# Run tests
# TODO
exit 0
fi
if [ $EXEC -eq 1 ]; then
# Install app requirements
docker compose exec app /bin/bash -c "npm install"
# Run application
docker compose exec app /bin/bash -c "ng serve --host 0.0.0.0 --configuration \$APP_ENVIRONMENT --port \$APP_PORT"
else
# Log into container
docker compose exec app /bin/bash
fi