diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d68d94d --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +all: env test + +clean: + bin/clean.sh + +env: + bin/env.sh + +test: + bin/test.sh diff --git a/bin/clean.sh b/bin/clean.sh new file mode 100755 index 0000000..7478c99 --- /dev/null +++ b/bin/clean.sh @@ -0,0 +1,9 @@ +#!/bin/bash -e + +set -o errexit -o nounset -o pipefail + +BASEDIR=`dirname $0`/.. + +rm -rf $BASEDIR/.tox $BASEDIR/env +echo "Deleted virtualenv and test artifacts." + diff --git a/bin/env.sh b/bin/env.sh new file mode 100755 index 0000000..8cdaeb5 --- /dev/null +++ b/bin/env.sh @@ -0,0 +1,22 @@ +#!/bin/bash -e + +BASEDIR=`dirname $0`/.. + +if [ ! -d "$BASEDIR/env" ]; then + virtualenv -q $BASEDIR/env --prompt='(dcos-cli) ' + echo "Virtualenv created." +fi + +cd $BASEDIR +source $BASEDIR/env/bin/activate +echo "Virtualenv activated." + +if [ ! -f "$BASEDIR/env/updated" -o $BASEDIR/setup.py -nt $BASEDIR/env/updated ]; then + pip install -e $BASEDIR + touch $BASEDIR/env/updated + echo "Requirements installed." +fi + +pip install tox +echo "Tox installed." + diff --git a/bin/test.sh b/bin/test.sh new file mode 100755 index 0000000..cccb3c8 --- /dev/null +++ b/bin/test.sh @@ -0,0 +1,9 @@ +#!/bin/bash -e + +BASEDIR=`dirname $0`/.. + +cd $BASEDIR +source $BASEDIR/env/bin/activate +echo "Virtualenv activated." + +tox