-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·31 lines (28 loc) · 982 Bytes
/
run.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
#!/usr/bin/env bash
if [ ! -f ".env" ]; then
echo "ERROR: You need to create a .env file!"
cp .env.sample .env
echo "A base .env file has been created for you. Fill out anything in brackets and rerun this command."
exit 1
fi
deploy_target=$1
stop_target=$2
mkdir -p public
./static-prebuild.sh
if [[ $deploy_target == "dev" ]]; then
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build
elif [[ $deploy_target == "prod" ]]; then
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up --build -d
elif [[ $deploy_target == "stop" ]]; then
if [[ $stop_target == "dev" ]]; then
docker-compose -f docker-compose.yml -f docker-compose.dev.yml stop
elif [[ $stop_target == "prod" ]]; then
docker-compose -f docker-compose.yml -f docker-compose.prod.yml stop
fi
else
echo "Invalid deployment target specified! Must run as either:"
echo " ./run.sh dev"
echo " ./run.sh prod"
echo " ./run.sh stop dev"
echo " ./run.sh stop prod"
fi