Skip to content

Commit

Permalink
Encapsulate build logic with bash and a Makefile.
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorDoyle committed Jan 28, 2015
1 parent bdcf172 commit 43cbaa5
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Makefile
@@ -0,0 +1,10 @@
all: env test

clean:
bin/clean.sh

env:
bin/env.sh

test:
bin/test.sh
9 changes: 9 additions & 0 deletions 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."

22 changes: 22 additions & 0 deletions 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."

9 changes: 9 additions & 0 deletions bin/test.sh
@@ -0,0 +1,9 @@
#!/bin/bash -e

BASEDIR=`dirname $0`/..

cd $BASEDIR
source $BASEDIR/env/bin/activate
echo "Virtualenv activated."

tox

0 comments on commit 43cbaa5

Please sign in to comment.