forked from Materials-Consortia/optimade-python-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·32 lines (28 loc) · 903 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
32
#!/bin/bash
if [ -z "$OPTIMADE_CONFIG_FILE" ]; then
export OPTIMADE_CONFIG_FILE="./optimade_config.json"
echo "Using the demo config file at ${OPTIMADE_CONFIG_FILE}."
echo "Set the environment variable OPTIMADE_CONFIG_FILE to override this behaviour."
echo "For more configuration options, please see https://www.optimade.org/optimade-python-tools/configuration/."
fi
export OPTIMADE_LOG_LEVEL=info
if [ "$1" == "debug" ]; then
export OPTIMADE_DEBUG=1
export OPTIMADE_LOG_LEVEL=debug
fi
if [ "$1" == "index" ]; then
MAIN="main_index"
PORT=5001
if [ "$2" == "debug" ]; then
export OPTIMADE_DEBUG=1
export OPTIMADE_LOG_LEVEL=debug
fi
else
if [ "${MAIN}" == "main_index" ]; then
PORT=5001
else
MAIN="main"
PORT=5000
fi
fi
uvicorn optimade.server.$MAIN:app --reload --port $PORT --log-level $OPTIMADE_LOG_LEVEL