-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
make.sh
executable file
·63 lines (50 loc) · 920 Bytes
/
make.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
set -Eeou pipefail
DOCKER_COMPOSE=$(docker compose > /dev/null 2>&1 && echo "docker compose" || echo "docker-compose")
build() {
$DOCKER_COMPOSE build
}
start() {
if [ ! -f .env ]; then
echo "Missing .env file; copy from .env.example and edit"
exit 1
fi
if [ ! -f config/notifications.json ]; then
echo "Missing config/notifications.json file; copy from config/notifications.json.example and edit"
exit 1
fi
$DOCKER_COMPOSE up -d
}
stop() {
$DOCKER_COMPOSE stop
}
deps() {
bin/install-whisper.sh
poetry install --with dev
}
lint() {
mypy app
ruff check app
ruff format app --check
}
fmt() {
ruff check app --fix
ruff format app
}
restart() {
$DOCKER_COMPOSE restart api worker
}
test() {
start
poetry run python3 tests/wait_for_api.py
poetry run python3 -m pytest $@
}
retest() {
restart
test
}
if [ -z "$1" ]; then
echo "Usage: $0 <command>"
exit 1
fi
$1 "${@:2}"