File tree Expand file tree Collapse file tree 4 files changed +24
-24
lines changed
Expand file tree Collapse file tree 4 files changed +24
-24
lines changed Original file line number Diff line number Diff line change @@ -11,25 +11,25 @@ RUN chmod +x /tini
1111ENTRYPOINT ["/tini" , "--" ]
1212
1313RUN apt-get update && \
14- apt-get -y install \
14+ apt-get -y install \
1515 wget \
1616 libssl-dev \
1717 libffi-dev \
1818 python-pip \
1919 python-software-properties \
2020 software-properties-common && \
21- add-apt-repository -y ppa:fkrull/deadsnakes && \
22- apt-get update && \
23- apt-get -y install \
21+ add-apt-repository -y ppa:fkrull/deadsnakes && \
22+ apt-get update && \
23+ apt-get -y install \
2424 python2.6 \
2525 python2.7 \
2626 python3.3 \
2727 python3.4 \
2828 python3.5 \
2929 git\
3030 pypy && \
31- apt-get clean && \
32- rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
31+ apt-get clean && \
32+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
3333
3434RUN mkdir /install && \
3535 wget -O /install/pypy3-2.4-linux_x86_64-portable.tar.bz2 \
Original file line number Diff line number Diff line change @@ -58,14 +58,14 @@ if [ ! -z ${API_KEY} ]; then
5858 cd /python-dev/examples
5959 if [ ! -z ${FILENAME} ]; then
6060 if [ ! -z ${ALT_URL} ]; then
61- python ${FILENAME} --key ${API_KEY} --url ${ALT_URL}
62- else
63- python ${FILENAME} --key ${API_KEY}
64- fi
61+ python ${FILENAME} --key ${API_KEY} --url ${ALT_URL}
62+ else
63+ python ${FILENAME} --key ${API_KEY}
64+ fi
6565 elif [ ! -z ${ALT_URL} ]; then
66- find -maxdepth 1 -name ' *.py' -print -exec python {} --key ${API_KEY} --url ${ALT_URL} \;
66+ find -maxdepth 1 -name ' *.py' -print -exec python {} --key ${API_KEY} --url ${ALT_URL} \;
6767 else
68- find -maxdepth 1 -name ' *.py' -print -exec python {} --key ${API_KEY} \;
68+ find -maxdepth 1 -name ' *.py' -print -exec python {} --key ${API_KEY} \;
6969 fi
7070else
7171 HELP
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