-
Notifications
You must be signed in to change notification settings - Fork 108
/
start.sh
executable file
·35 lines (31 loc) · 890 Bytes
/
start.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
#!/bin/sh
s_type=$1
s_env=$2
if [ ${s_type} == "api" ]
then
script_command="gunicorn -c src/config/gunicorn.py src.api.http_app:app"
elif [ ${s_type} == "schedule" ]
then
script_command="python src/liuli_schedule.py"
else
echo "Service type doesn't exist: "$s_type
exit
fi
if [ ${s_env} == "local" ]
then
start_script="PIPENV_DOTENV_LOCATION=./.env pipenv run "$script_command
elif [ ${s_env} == "dev" ]
then
start_script="PIPENV_DOTENV_LOCATION=./dev.env pipenv run "$script_command
elif [ ${s_env} == "pro" ]
then
start_script="PIPENV_DOTENV_LOCATION=./pro.env pipenv run "$script_command
elif [ ${s_env} == "online" ]
then
start_script="PIPENV_DOTENV_LOCATION=./online.env pipenv run "$script_command
else
echo "Environment variable type doesn't exist: "$s_type
exit
fi
echo "Start "$s_type"("$s_env") serve: "$start_script
eval $start_script