-
Notifications
You must be signed in to change notification settings - Fork 0
/
moe.sh
executable file
·33 lines (27 loc) · 974 Bytes
/
moe.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
#!/bin/bash
VERSION=0.0.1
if [ $1 = "version" -o $1 = "v" -o $1 = "-v" ]; then
echo $VERSION
elif [ $1 = "init" ]; then
shift
docker compose build
docker compose run web yarn install
elif [ $1 = "install" -o $1 = "i" ]; then
shift
docker run -it -v $(pwd)/web:/app -w /app node:current-alpine yarn add "$@"
elif [ $1 = "build" ]; then
docker run -it -v $(pwd)/web:/app -w /app -p 5555:5555 node:current-alpine yarn parcel watch --no-cache --port 5555 src/index.html
elif [[ $1 = "run" || $1 =~ "serve" || $1 =~ "dev" ]]; then
shift
# uvicorn --reload --host 0.0.0.0 --port 5000 main:app
docker compose -f docker-compose.yml -f dev.yml up "$@"
# Starts in production.
elif [ $1 = "prod" -o $1 = "production" -o $1 = "p" ]; then
shift
echo "moe running production $1"
docker compose down && \
docker compose -f docker-compose.yml -f production.yml up --build -d $1
elif [ $1 = "log" -o $1 = "l" ]; then
shift
docker compose logs "$@"
fi