Skip to content

Commit fad6be3

Browse files
author
Matthew Fisher
committed
Merge pull request #650 from opdemand/fix-controller-make-test
Run django unit tests via 'make test'.
2 parents e42856e + ce5b1bf commit fad6be3

2 files changed

Lines changed: 22 additions & 21 deletions

File tree

controller/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@ FROM deis/base:latest
22
MAINTAINER Gabriel A. Monroy <gabriel@opdemand.com>
33

44
# install required system packages
5-
RUN apt-get update
6-
RUN apt-get install -yq python-dev libpq-dev
7-
# install latest pip
8-
RUN wget -q https://raw.github.com/pypa/pip/1.5.4/contrib/get-pip.py && \
9-
python get-pip.py && \
10-
rm get-pip.py
5+
RUN apt-get update && \
6+
apt-get install -yq python-dev libpq-dev libyaml-dev
117

128
# install chef
139
RUN apt-get install -yq ruby1.9.1 rubygems
1410
RUN gem install --no-ri --no-rdoc chef
1511

12+
# install latest pip
13+
RUN wget -qO- https://raw.github.com/pypa/pip/1.5.4/contrib/get-pip.py | python -
14+
1615
# install requirements before ADD to cache layer and speed build
1716
RUN pip install boto==2.23.0 celery==3.1.8 Django==1.6.2 django-allauth==0.15.0 django-guardian==1.1.1 django-json-field==0.5.5 django-yamlfield==0.5 djangorestframework==2.3.12 dop==0.1.4 gevent==1.0 gunicorn==18.0 paramiko==1.12.1 psycopg2==2.5.2 pycrypto==2.6.1 python-etcd==0.3.0 pyrax==1.6.2 PyYAML==3.10 redis==2.8.0 static==1.0.2 South==0.8.4
1817

@@ -37,5 +36,6 @@ RUN mkdir -p /templates && chown -R deis:deis /templates
3736
RUN mkdir -p /var/log/deis && chown -R deis:deis /var/log/deis
3837

3938
# define the execution environment
39+
WORKDIR /app
4040
CMD ["/app/bin/boot"]
4141
EXPOSE 8000

controller/Makefile

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1-
runserver:
2-
python manage.py runserver
3-
4-
db:
5-
python manage.py syncdb --migrate --noinput
6-
7-
test:
8-
python manage.py test --noinput api cm provider web
9-
10-
coverage:
11-
coverage run manage.py test --noinput api cm provider web
12-
coverage html
13-
141
build:
152
docker build -t deis/controller .
163

174
run:
18-
docker run -rm -p $${PORT:-8000}:$${PORT:-8000} -e ETCD=$${ETCD:-127.0.0.1:4001} -name deis-controller deis/controller ; exit 0
5+
docker run -p $${PORT:-8000}:$${PORT:-8000} -e ETCD=$${ETCD:-127.0.0.1:4001} -name deis-controller deis/controller
6+
exit 0
197

208
shell:
21-
docker run -t -i -rm -e ETCD=$${ETCD:-127.0.0.1:4001} deis/controller /bin/bash
9+
docker run -t -i -e ETCD=$${ETCD:-127.0.0.1:4001} deis/controller /bin/bash
2210

2311
clean:
2412
-docker rmi deis/controller
2513

14+
test:
15+
python manage.py test --noinput api cm provider web
16+
17+
runserver:
18+
python manage.py runserver
19+
20+
db:
21+
python manage.py syncdb --migrate --noinput
22+
23+
coverage:
24+
coverage run manage.py test --noinput api cm provider web
25+
coverage html
26+
2627
flake8:
2728
flake8

0 commit comments

Comments
 (0)