Skip to content

Commit 6eb7a24

Browse files
committed
Docker image can run unit tests against all different versions of python, git doesn't prompt for passphrase anymore and it's properly configured.
1 parent e37350a commit 6eb7a24

426 files changed

Lines changed: 48 additions & 84498 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docker/Dockerfile

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,52 @@
1-
FROM python:2.7.11
1+
FROM ubuntu:14.04
22
MAINTAINER Fiona Hasanaj
33

4-
# install necessary software
5-
RUN apt-get -y update && apt-get install -y vim && apt-get install -y git && pip install tox
4+
ENV DEBIAN_FRONTEND noninteractive
5+
RUN locale-gen en_US.UTF-8 && /usr/sbin/update-locale LANG=en_US.UTF-8
6+
ENV LANG en_US.UTF-8
7+
8+
# proper init to handle signal propagation and zombie reaping
9+
ADD https://github.com/krallin/tini/releases/download/v0.8.4/tini /tini
10+
RUN chmod +x /tini
11+
ENTRYPOINT ["/tini", "--"]
12+
13+
RUN apt-get update && \
14+
apt-get -y install \
15+
wget \
16+
libssl-dev \
17+
libffi-dev \
18+
python-pip \
19+
python-software-properties \
20+
software-properties-common && \
21+
add-apt-repository -y ppa:fkrull/deadsnakes && \
22+
apt-get update && \
23+
apt-get -y install \
24+
python2.6 \
25+
python2.7 \
26+
python3.3 \
27+
python3.4 \
28+
python3.5 \
29+
git\
30+
pypy && \
31+
apt-get clean && \
32+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
33+
34+
RUN mkdir /install && \
35+
wget -O /install/pypy3-2.4-linux_x86_64-portable.tar.bz2 \
36+
"https://bitbucket.org/squeaky/portable-pypy/downloads/pypy3-2.4-linux_x86_64-portable.tar.bz2" && \
37+
tar jxf /install/pypy3-*.tar.bz2 -C /install && \
38+
rm /install/pypy3-*.tar.bz2 && \
39+
ln -s /install/pypy3-*/bin/pypy3 /usr/local/bin/pypy3
40+
41+
RUN pip install -U pip && pip install tox
42+
43+
# copy over the necessary files
644
COPY run_python.sh /python-dev/run_python.sh
745
RUN chmod 755 /python-dev/run_python.sh
846
COPY tox.ini /python-dev/tox.ini
947
WORKDIR /python-dev
1048

1149
# allow interactive bash inside docker container
12-
CMD ./run_python.sh $API_KEY $FILENAME $ALT_URL $GIT_USRERNAME $VERSION
50+
CMD ./run_python.sh $API_KEY $FILENAME $ALT_URL $GIT_USERNAME $VERSION
1351

1452
VOLUME ["/source"]

docker/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ To simplify the running of the Python examples, the Dockerfile will build an ima
77
### Basic Usage
88
Build the docker image, e.g. `docker build -t basistech/python:1.1 .`
99

10-
Run an example as `docker run -it -e API_KEY=api-key -v "path-to-local-python-dir:/source" basistech/python:1.1`
10+
Run an example as `docker run -e API_KEY=api-key -v "path-to-local-python-dir:/source" basistech/python:1.1`
1111

12-
To test against a specific source file, add `-e FILENAME=filename` before the `-v`, to test against an alternate url, add `-e ALT_URL=alternate_url`, and optionally if you would like to regenerate gh-pages from the changes made to the development source you can add `-e GIT_USERNAME=git-username -e VERSION=version` before the `-v`.
12+
To test against a specific source file, add `-e FILENAME=filename` before the `-v`, to test against an alternate url, add `-e ALT_URL=alternate_url`, and optionally if you would like to regenerate gh-pages from the changes made to the development source you can add `-e GIT_USERNAME=git-username -e VERSION=version` before the `-v`. In order to push the gh-pages to git remember to mount .ssh and .gitconfig to the root dir `-v path-to-.ssh-dir:/root/.ssh -v path-to-.gitconfig:/root/.gitconfig`.

docker/run_python.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,9 @@ tox
7777

7878
#Generate gh-pages and push them to git account (if git username is provided)
7979
if [ ! -z ${GIT_USERNAME} ] && [ ! -z ${VERSION} ]; then
80-
#configure git
81-
git config --global user.email "${GIT_USERNAME}"
82-
git config --global user.name "${GIT_USERNAME}"
8380
#clone python git repo
8481
cd /
85-
git clone https://${GIT_USERNAME}@github.com/${GIT_USERNAME}/python.git
82+
git clone git@github.com:${GIT_USERNAME}/python.git
8683
cd python
8784
git checkout origin/gh-pages -b gh-pages
8885
git branch -d develop

docker/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
[tox]
77
skipsdist = True
8-
envlist = py27
8+
envlist = py26, py27, py33, py34
99

1010
[testenv]
1111
commands =

tests/mock-data/request/ara-doc-categories.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/mock-data/request/ara-doc-entities.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/mock-data/request/ara-doc-entities_linked.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/mock-data/request/ara-doc-language.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/mock-data/request/ara-doc-morphology_complete.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/mock-data/request/ara-doc-sentiment.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)