File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed
Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,13 @@ FROM python:2.7.11
22MAINTAINER 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
77COPY run_python.sh /python/examples/run_python.sh
88RUN chmod 755 /python/examples/run_python.sh
99WORKDIR /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
1414VOLUME ["/source" ]
Original file line number Diff line number Diff 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
2929done
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
4444if [ ! -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
5757else
5858 HELP
You can’t perform that action at this time.
0 commit comments