Skip to content

Commit 23174cb

Browse files
authored
Merge pull request #124 from pricingassistant/travis
Switch to Travis & Add Python 3 to the Dockerfile
2 parents a8fa962 + 008af9d commit 23174cb

6 files changed

Lines changed: 63 additions & 46 deletions

File tree

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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
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 --cov mrq --cov-report term
20+

Dockerfile

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,49 @@
11
FROM debian:jessie
22

3+
#
4+
# httpredir.debian.org is often unreliable
5+
# https://github.com/docker-library/buildpack-deps/issues/40
6+
#
7+
8+
RUN echo \
9+
'deb ftp://ftp.us.debian.org/debian/ jessie main\n \
10+
deb ftp://ftp.us.debian.org/debian/ jessie-updates main\n \
11+
deb http://security.debian.org jessie/updates main\n' \
12+
> /etc/apt/sources.list
13+
314
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
415
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
516
RUN apt-get update && \
6-
apt-get install -y curl gcc python-dev mongodb-org-server nginx redis-server && \
17+
apt-get install -y --no-install-recommends \
18+
curl \
19+
gcc \
20+
python-dev \
21+
python-pip \
22+
python3-pip \
23+
python3-dev \
24+
git \
25+
vim \
26+
mongodb-org-server \
27+
nginx redis-server \
28+
&& \
729
apt-get clean -y && \
830
rm -rf /var/lib/apt/lists/*
931

10-
RUN curl -s "https://bootstrap.pypa.io/get-pip.py" | python
32+
# Upgrade pip
33+
RUN pip install --upgrade --ignore-installed pip
34+
RUN pip3 install --upgrade --ignore-installed pip
1135

1236
ADD requirements-heroku.txt /app/requirements-heroku.txt
1337
ADD requirements-base.txt /app/requirements-base.txt
1438
ADD requirements-dev.txt /app/requirements-dev.txt
1539
ADD requirements-dashboard.txt /app/requirements-dashboard.txt
1640

41+
RUN pip3 install -r /app/requirements-heroku.txt && \
42+
pip3 install -r /app/requirements-base.txt && \
43+
pip3 install -r /app/requirements-dev.txt && \
44+
pip3 install -r /app/requirements-dashboard.txt && \
45+
rm -rf ~/.cache
46+
1747
RUN pip install -r /app/requirements-heroku.txt && \
1848
pip install -r /app/requirements-base.txt && \
1949
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)