-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdevelop.sh
executable file
·53 lines (50 loc) · 1.49 KB
/
develop.sh
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
# Set environment variables for dev
export NODE_ENV=${APP_ENV:-development}
export PORT=${PORT:-8080}
export APP_NAME=${APP_NAME:-crypto.bot}
export SERVICE_PREFIX=${SERVICE_PREFIX:-crypto.bot}
export DB_PORT=${DB_PORT:-3307}
export DB_ROOT_PASSWORD=${DB_ROOT_PASSWORD:-password}
export DB_DATABASE=${DB_DATABASE:-homestead}
export DB_USER=${DB_USER:-homestead}
export DB_PASSWORD=${DB_PASSWORD:-secret}
# Decide which compose command & docker-compose file to use
COMPOSE="docker-compose -f ./deploy/docker-compose.yml"
if [ $# -gt 0 ];then
# If "build" is used, run the build command
if [ "$1 $2" == "build db" ]; then
shift 1
docker build -f ./deploy/mysql/Dockerfile .
elif [ "$1" == "build" ]; then
shift 1
docker build -f ./deploy/api/Dockerfile .
elif [ "$1" == "bash" ]; then
shift 1
docker exec -it crypto.bot-api /bin/sh
elif [ "$1" == "mfs" ]; then
shift 1
$COMPOSE run --rm \
-w /srv/app \
--entrypoint "adonis migration:refresh --seed" \
api-crypto \
"$@"
elif [ "$1" == "test" ]; then
shift 1
$COMPOSE run --rm \
-w /srv/app \
--entrypoint "adonis test" \
api-crypto \
"$@"
elif [ "$1" == "adonis" ]; then
shift 1
$COMPOSE run --rm \
-w /srv/app \
--entrypoint "adonis" \
api-crypto \
"$@"
else
$COMPOSE "$@"
fi
else
$COMPOSE ps
fi