Skip to content

Commit 3f6a533

Browse files
committed
Removed unnecessary commands in docker image which runs against published source.
1 parent 8a0464a commit 3f6a533

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

examples/docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ FROM python:2.7.11
22
MAINTAINER Fiona Hasanaj
33

44
# install necessary software
5-
RUN apt-get -y update && apt-get install -y vim && apt-get install -y git && pip install tox
5+
RUN apt-get -y update && apt-get install -y vim && apt-get install -y git && pip install rosette_api
66

77
COPY run_python.sh /python/examples/run_python.sh
88
RUN chmod 755 /python/examples/run_python.sh
99
WORKDIR /python/examples
1010

1111
# allow interactive bash inside docker container
12-
CMD ./run_python.sh $API_KEY $ALT_URL
12+
CMD ./run_python.sh $API_KEY $FILENAME $ALT_URL
1313

1414
VOLUME ["/source"]

examples/docker/run_python.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ while getopts ":API_KEY:FILENAME:ALT_URL" arg; do
1717
API_KEY=${OPTARG}
1818
usage
1919
;;
20-
ALT_URL)
21-
ALT_URL=${OPTARG}
22-
usage
23-
;;
2420
FILENAME)
2521
FILENAME=${OPTARG}
2622
usage
2723
;;
24+
ALT_URL)
25+
ALT_URL=${OPTARG}
26+
usage
27+
;;
2828
esac
2929
done
3030

@@ -37,22 +37,22 @@ function checkAPI {
3737
fi
3838
}
3939

40-
#Copy the mounted content in /source to current WORKDIR
41-
cp /source/*.* .
40+
#Copy the examples from the mounted content in /source to current WORKDIR
41+
cp /source/examples/*.* .
4242

4343
#Run the examples
4444
if [ ! -z ${API_KEY} ]; then
4545
checkAPI
4646
if [ ! -z ${FILENAME} ]; then
4747
if [ ! -z ${ALT_URL} ]; then
48-
tox -- ${FILENAME} --key ${API_KEY} --url ${ALT_URL}
48+
python ${FILENAME} --key ${API_KEY} --url ${ALT_URL}
4949
else
50-
tox -- ${FILENAME} --key ${API_KEY}
50+
python ${FILENAME} --key ${API_KEY}
5151
fi
5252
elif [ ! -z ${ALT_URL} ]; then
53-
find -maxdepth 1 -name '*.py' -print -exec tox -- {} --key ${API_KEY} --url ${ALT_URL} \;
53+
find -maxdepth 1 -name '*.py' -print -exec python {} --key ${API_KEY} --url ${ALT_URL} \;
5454
else
55-
find -maxdepth 1 -name '*.py' -print -exec tox -- {} --key ${API_KEY} \;
55+
find -maxdepth 1 -name '*.py' -print -exec python {} --key ${API_KEY} \;
5656
fi
5757
else
5858
HELP

0 commit comments

Comments
 (0)