Skip to content

Commit 8c1c617

Browse files
committed
Add docker.sh script
1 parent 85a5aae commit 8c1c617

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

docker.sh

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
###########
2+
# How to use docker.sh
3+
# $ export AUTO_TEST=true # false will prompt you to a shell inside the container
4+
# $ export DOCKER_IMAGE="hadim/py3-env" # or hadim/py2-env
5+
# $ export BRANCH="master" # branch to build
6+
###########
7+
8+
# If AUTO_TEST=true then scikit-tracker will be automatic
9+
# If AUTO_TEST=false you will be prompted to a shell inside the container
10+
AUTO_TEST=${AUTO_TEST:-true}
11+
BRANCH=${BRANCH:-master}
12+
13+
DOCKER_IMAGE=${DOCKER_IMAGE:-hadim/py3-env}
14+
DOCKER_CONTAINER="py-env"
15+
16+
TMP_BUILDER="/tmp/docker_builder_script"
17+
CURRENT_DIR=$(pwd)
18+
19+
mkdir -p $TMP_BUILDER
20+
21+
builder="export PATH=/miniconda/bin:$PATH;
22+
export BRANCH="$BRANCH";
23+
24+
cd /
25+
git clone https://github.com/bnoi/scikit-tracker.git;
26+
cd scikit-tracker/;
27+
git checkout $BRANCH;
28+
29+
make init;
30+
31+
python setup.py build_ext --inplace;
32+
python setup.py install;
33+
python setup.py bdist_wheel;
34+
35+
nosetests sktracker --with-coverage --cover-package=sktracker -v;
36+
make doc;"
37+
38+
printf "$builder" > $TMP_BUILDER/builder.sh
39+
40+
docker pull $DOCKER_IMAGE
41+
42+
docker rm -vf $DOCKER_CONTAINER 2> /dev/null
43+
44+
if [ "$AUTO_TEST" = true ] ; then
45+
docker run --name $DOCKER_CONTAINER -v $TMP_BUILDER:/builder:ro $DOCKER_IMAGE sh /builder/builder.sh
46+
fi
47+
echo "You are now prompted to an interactive shell inside a container."
48+
echo "You can launch ./sh/builder/builder.sh to build scikit-tracker"
49+
docker run -i -t --name $DOCKER_CONTAINER -v $TMP_BUILDER:/builder:ro $DOCKER_IMAGE /bin/bash
50+
51+

0 commit comments

Comments
 (0)