File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,25 @@ cleanup() {
2323}
2424trap cleanup EXIT
2525
26+ PY_VER=2
27+ while getopts :p: opt " $@ " ; do
28+ case $opt in
29+ p)
30+ PY_VER=$OPTARG ;;
31+ * )
32+ echo " Unknown option: $opt "
33+ exit 1;;
34+ esac
35+ done
36+
37+ case $PY_VER in
38+ 2) VENV_CMD=virtualenv;;
39+ 3) VENV_CMD=pyvenv;;
40+ * )
41+ echo " Wrong python version (2 or 3)"
42+ exit 1;;
43+ esac
44+
2645docker run --name gitlab-test --detach --publish 8080:80 --publish 2222:22 genezys/gitlab:latest > /dev/null 2>&1
2746
2847LOGIN=' root'
@@ -31,7 +50,7 @@ CONFIG=/tmp/python-gitlab.cfg
3150GITLAB=" gitlab --config-file $CONFIG "
3251VENV=$( pwd) /.venv
3352
34- virtualenv $VENV
53+ $VENV_CMD $VENV
3554. $VENV /bin/activate
3655pip install -rrequirements.txt
3756pip install -e .
5574TOKEN=$( curl -s http://localhost:8080/api/v3/session \
5675 -X POST \
5776 --data " login=$LOGIN &password=$PASSWORD " \
58- | python -c ' import sys, json; print json.load(sys.stdin)["private_token"]' )
77+ | python -c ' import sys, json; print( json.load(sys.stdin)["private_token"]) ' )
5978
6079cat > $CONFIG << EOF
6180[global]
You can’t perform that action at this time.
0 commit comments