Skip to content

Commit 502c32c

Browse files
committed
Add Python3 in Dockerfile & switch to Travis
1 parent 882d90e commit 502c32c

6 files changed

Lines changed: 51 additions & 46 deletions

File tree

.travis.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
sudo: required
2+
3+
services:
4+
- docker
5+
6+
env:
7+
- PYTHON_BIN=python
8+
- PYTHON_BIN=python3
9+
10+
before_install:
11+
- docker ps
12+
- docker info
13+
- docker version
14+
- make docker_build
15+
- make linterrors
16+
17+
# TODO: coveralls?
18+
script:
19+
- docker run -i -t -v `pwd`:/app:rw -w /app mrq_local $PYTHON_BIN -m pytest tests/ -v --junitxml=pytest-report.xml --html=pytest-report.html --cov mrq --cov-report term

Dockerfile

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,36 @@ FROM debian:jessie
33
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
44
RUN echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.0 main" > /etc/apt/sources.list.d/mongodb-org-3.0.list
55
RUN apt-get update && \
6-
apt-get install -y curl gcc python-dev mongodb-org-server nginx redis-server && \
6+
apt-get install -y --no-install-recommends \
7+
curl \
8+
gcc \
9+
python-dev \
10+
python-pip \
11+
python3-pip \
12+
python3-dev \
13+
git \
14+
vim \
15+
mongodb-org-server \
16+
nginx redis-server \
17+
&& \
718
apt-get clean -y && \
819
rm -rf /var/lib/apt/lists/*
920

10-
RUN curl -s "https://bootstrap.pypa.io/get-pip.py" | python
21+
# Upgrade pip
22+
RUN pip install --upgrade --ignore-installed pip
23+
RUN pip3 install --upgrade --ignore-installed pip
1124

1225
ADD requirements-heroku.txt /app/requirements-heroku.txt
1326
ADD requirements-base.txt /app/requirements-base.txt
1427
ADD requirements-dev.txt /app/requirements-dev.txt
1528
ADD requirements-dashboard.txt /app/requirements-dashboard.txt
1629

30+
RUN pip3 install -r /app/requirements-heroku.txt && \
31+
pip3 install -r /app/requirements-base.txt && \
32+
pip3 install -r /app/requirements-dev.txt && \
33+
pip3 install -r /app/requirements-dashboard.txt && \
34+
rm -rf ~/.cache
35+
1736
RUN pip install -r /app/requirements-heroku.txt && \
1837
pip install -r /app/requirements-base.txt && \
1938
pip install -r /app/requirements-dev.txt && \

Makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@ docker:
22
docker build -t mrq_local .
33

44
test: docker
5-
sh -c "docker run --rm -i -t -p 27017:27017 -p 6379:6379 -p 5555:5555 -p 20020:20020 -v `pwd`:/app:rw -w /app mrq_local py.test tests/ -v --instafail"
5+
sh -c "docker run --rm -i -t -p 27017:27017 -p 6379:6379 -p 5555:5555 -p 20020:20020 -v `pwd`:/app:rw -w /app mrq_local python -m pytest tests/ -v --instafail"
66

7-
test_jenkins: docker
8-
sh -c "docker run --rm -i -t -p 27017:27017 -p 6379:6379 -p 5555:5555 -p 20020:20020 -v `pwd`:/app:rw -w /app mrq_local /usr/local/bin/py.test tests/ --cov-report=xml --junitxml=test_suite_report.xml --cov mrq"
9-
10-
ssh:
7+
shell:
118
sh -c "docker run --rm -i -t -p 27017:27017 -p 6379:6379 -p 5555:5555 -p 20020:20020 -p 8000:8000 -v `pwd`:/app:rw -w /app mrq_local bash"
129

13-
ssh_noport:
10+
shell_noport:
1411
sh -c "docker run --rm -i -t -v `pwd`:/app:rw -w /app mrq_local bash"
1512

1613
docs_serve:

circle.yml

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

requirements-base.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ gevent>=1.1rc3
55
ujson==1.33
66
hiredis>=0.1.5
77
psutil==1.2.1
8-
supervisor==3.0
9-
subprocess32==3.2.7
108
objgraph==1.8.1
119
termcolor==1.1.0
10+
11+
subprocess32==3.2.7; python_version < '3.2'
12+
13+
supervisor==3.0; python_version < '3.0'
14+
git+git://github.com/Supervisor/supervisor.git@c18aecf1641d8953767e7010be8bae1924a133bf#egg=Supervisor; python_version >= '3.0'

requirements-dev.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
pytest==2.7.0
22
pylint==1.5.2
33
pytest-cov==1.8.1
4-
pytest-html==1.0
54
pytest-httpbin==0.0.6
6-
pytest-circleci==0.0.2
75
pytest-instafail==0.3.0
86

9-
subprocess32==3.2.5
10-
#git+https://github.com/srlindsay/gevent-profiler@master#egg=gevent-profiler==0.2
7+
# git+https://github.com/srlindsay/gevent-profiler@master#egg=gevent-profiler==0.2
118

129
# Used to test IO tracing
1310
requests==2.4.3
1411

15-
mkdocs==0.11.1
16-
mistune==0.5
12+
mkdocs==0.15.3
13+
mistune==0.7.3

0 commit comments

Comments
 (0)