32 lines
531 B
Bash
32 lines
531 B
Bash
#!/bin/sh
|
|
|
|
usage() {
|
|
cat <<EOF
|
|
usage: ${0##*/} [command]
|
|
-h Print this help message.
|
|
-a Run API.
|
|
-i Install.
|
|
-d Run docker-compose.
|
|
EOF
|
|
exit 1
|
|
}
|
|
|
|
RUN=
|
|
while getopts "hadi" OPTION; do
|
|
case $OPTION in
|
|
a) RUN=api ;;
|
|
d) RUN=docker ;;
|
|
i) RUN=install ;;
|
|
*) usage ;;
|
|
esac
|
|
done
|
|
|
|
if [ "$RUN" = 'install' ]; then
|
|
poetry install
|
|
elif [ "$RUN" = 'api' ]; then
|
|
poetry shell
|
|
uvicorn api.api:app --host 0.0.0.0 --reload
|
|
else
|
|
docker-compose up
|
|
fi
|