-
-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathdevelop.sh
More file actions
executable file
·28 lines (24 loc) · 793 Bytes
/
develop.sh
File metadata and controls
executable file
·28 lines (24 loc) · 793 Bytes
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
#!/usr/bin/env bash
if [[ ! -d "docker" ]]; then
echo "This script must be run from the top level directory of the acousticbrainz-server source."
exit -1
fi
docker_compose() {
exec docker-compose -f docker/docker-compose.dev.yml -p acousticbrainz-server "$@"
}
run() {
docker_compose run --rm --user `id -u`:`id -g` "$@"
}
if [[ "$1" == "manage" ]]; then shift
run webserver python manage.py "$@"
elif [[ "$1" == "psql" ]]; then shift
run db psql -h db -U acousticbrainz acousticbrainz
elif [[ "$1" == "bash" ]]; then shift
docker_compose run --rm webserver bash
elif [[ "$1" == "shell" ]]; then shift
docker_compose run --rm webserver flask shell
elif [[ "$1" == "npm" ]]; then shift
run -e HOME=/tmp webserver npm "$@"
else
docker_compose "$@"
fi