-
Notifications
You must be signed in to change notification settings - Fork 1
/
go.sh
executable file
·97 lines (91 loc) · 2.13 KB
/
go.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
set -e
while test $# -gt 0; do
case "$1" in
-h|--help)
echo "run with no arguments to run everything"
exit 0
;;
--tasks*)
export TASKS=`echo $1 | sed -e 's/^[^=]*=//g'`
shift
;;
--settings*)
export SETTINGS_FILE=`echo $1 | sed -e 's/^[^=]*=//g'`
shift
;;
--venv*)
export VENV=`echo $1 | sed -e 's/^[^=]*=//g'`
shift
;;
ut)
export TASKS='ut'
shift
;;
ft)
export TASKS='ft'
shift
;;
js)
export TASKS='jsTest'
shift
;;
*)
export ARG="$1"
break
;;
esac
done
if [ ! "$SETTINGS_FILE" == "" ]
then
echo "Using settings file - $SETTINGS_FILE"
fi
if [ "$TASKS" == "" ]
then
export TASKS='setup','migrate','ut','ft'
fi
if [ ! -a $VENV ]
then
echo "setting venv"
source $VENV
fi
arr=$(echo $TASKS | tr "," "\n")
for x in $arr
do
case $x in
setup)
echo "running setup"
pip install -r pip-requirements.txt
pip install coveralls
;;
migrate)
echo "running migrations"
./manage.py syncdb --noinput
./manage.py migrate
;;
jsTest)
echo "running js tests"
./node_modules/karma/bin/karma start
;;
ut)
echo "running unit tests"
echo "Testing $ARG"
if [ -a $SETTINGS_FILE ]
then
./manage.py test --settings=$SETTINGS_FILE $ARG
else
./manage.py test $ARG
fi
;;
ft)
echo "running functional tests"
echo "Testing $ARG"
if [ -a $SETTINGS_FILE ]
then
./manage.py harvest --tag=-WIP --tag=-Upload --settings=$SETTINGS_FILE $ARG
else
./manage.py harvest --tag=-WIP --tag=-Upload $ARG
fi
;;
esac
done