forked from OpenDroneMap/WebODM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
devenv.sh
executable file
·47 lines (40 loc) · 1.05 KB
/
devenv.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
#!/bin/bash
set -eo pipefail
__dirname=$(cd $(dirname "$0"); pwd -P)
${__dirname}/webodm.sh checkenv
usage(){
echo "Usage: $0 <command> [options]"
echo
echo "This program helps to setup a development environment for WebODM using docker."
echo
echo "Command list:"
echo " start Start the development environment"
echo " stop Stop the development environment"
echo " runtests [tests] Run unit tests. You can specify an optional extra parameter such as app.tests.test_db to limit the scope of the tests. Defaults to running all tests."
exit
}
run(){
echo $1
eval $1
}
start(){
run "docker-compose -f docker-compose.yml -f docker-compose.nodeodm.yml -f docker-compose.dev.yml up"
}
stop(){
run "${__dirname}/webodm.sh stop"
}
runtests(){
run "docker-compose exec webapp python manage.py test $1"
}
if [[ $1 = "start" ]]; then
echo "Starting development environment..."
start
elif [[ $1 = "stop" ]]; then
echo "Stopping development environment..."
stop
elif [[ $1 = "runtests" ]]; then
echo "Starting tests..."
runtests "$2"
else
usage
fi