Skip to content

Commit e488786

Browse files
committed
Merge branch 'develop' of github.com:rosette-api/python into develop
2 parents c433cf0 + 2b22cdb commit e488786

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

docker/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@ RUN chmod +x /tini
1111
ENTRYPOINT ["/tini", "--"]
1212

1313
RUN 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

3434
RUN mkdir /install && \
3535
wget -O /install/pypy3-2.4-linux_x86_64-portable.tar.bz2 \

docker/run_python.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff 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
7070
else
7171
HELP

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)