Skip to content

Commit b34a944

Browse files
committed
add some Docker images to make it easier to try against multiple versions of Django
1 parent 28dacab commit b34a944

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

Diff for: .dockerignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.pyc
2+
.coverage
3+
4+
.env
5+
.tox/
6+
*.db
7+
8+
9+
build/
10+
dist/
11+
*.egg-info

Diff for: Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM python:2-onbuild
2+
3+
ARG DJANGO_VERSION
4+
5+
RUN pip install django==$DJANGO_VERSION
6+
7+
ENV PORT 8000
8+
EXPOSE 8000
9+
10+
ENV PYTHONPATH /usr/src/app
11+
12+
CMD python example_project/manage.py runserver 0.0.0.0:$PORT

Diff for: Makefile

+18
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ resetdb: ## Delete and then recreate the dev sqlite database
3535
python $(MANAGE) migrate --noinput
3636
python $(MANAGE) loaddata sample_data
3737

38+
IMAGE = crccheck/django-object-actions
39+
40+
.PHONY: build
41+
build: ## Build a full set of Docker images
42+
build: build/1.9 build/1.8.7 build/1.7.11 build/1.6.11 build/1.5.12
43+
44+
build/%:
45+
docker build --build-arg DJANGO_VERSION=$* \
46+
-t $(IMAGE):$$(echo "$*" | cut -f 1-2 -d.) .
47+
48+
run: run/1.9
49+
50+
run/%:
51+
docker run --rm -p 8000:8000 --sig-proxy=false $(IMAGE):$*
52+
53+
bash:
54+
docker run --rm -it $(IMAGE):1.9 /bin/bash
55+
3856
version:
3957
@sed -i -r /version/s/[0-9.]+/$(VERSION)/ setup.py
4058
@sed -i -r /version/s/[0-9.]+/$(VERSION)/ django_object_actions/__init__.py

0 commit comments

Comments
 (0)