Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
add circle.yml and Dockerfile (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
oremj authored Aug 10, 2016
1 parent 9b74274 commit 1f35535
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 2 deletions.
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM python:2.7

RUN mkdir -p /app
COPY . /app/tuxedo/tuxedo

WORKDIR /app/tuxedo/tuxedo

RUN \
apt-get update && \
apt-get install -y -qq python-mysqldb && \
pip install -r requirements.txt && \
pip install gunicorn==19.6.0 && \
cp wsgi/tuxedo.wsgi wsgirunner.py

EXPOSE 8000

ENV PYTHONPATH="/app/tuxedo:/app/tuxedo/tuxedo/vendor/lib/python:/app/tuxedo/tuxedo/vendor/src"

CMD gunicorn -b 127.0.0.1:8000 -w 24 wsgirunner
51 changes: 51 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# These environment variables must be set in CircleCI UI
#
# DOCKERHUB_REPO - docker hub repo, format: <username>/<repo>
# DOCKER_EMAIL - login info for docker hub
# DOCKER_USER
# DOCKER_PASS
#
machine:
services:
- docker

dependencies:
override:
- docker info

# create a version.json
- >
printf '{"commit":"%s","version":"%s","source":"https://github.com/%s/%s","build":"%s"}\n'
"$CIRCLE_SHA1"
"$CIRCLE_TAG"
"$CIRCLE_PROJECT_USERNAME"
"$CIRCLE_PROJECT_REPONAME"
"$CIRCLE_BUILD_URL"
> version.json
- docker build -t app:build .

test:
override:
- 'true'

# appropriately tag and push the container to dockerhub
deployment:
hub_latest:
branch: "master"
commands:
- "[ ! -z $DOCKERHUB_REPO ]"
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- "docker tag app:build ${DOCKERHUB_REPO}:latest"
- "docker push ${DOCKERHUB_REPO}:latest"

hub_releases:
# push all tags
tag: /.*/
commands:
- "[ ! -z $DOCKERHUB_REPO ]"
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- "echo ${DOCKERHUB_REPO}:${CIRCLE_TAG}"
- "docker tag app:build ${DOCKERHUB_REPO}:${CIRCLE_TAG}"
- "docker images"
- "docker push ${DOCKERHUB_REPO}:${CIRCLE_TAG}"
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Django==1.2
MySQL-python==1.2.3c1
ipaddr==2.0.0
ipaddr==2.1.11
Markdown==2.0.3
South>=0.6.2
python-memcached==1.45
python-memcached==1.48
git+git://github.com/fwenzel/django-mozilla-product-details#egg=django-mozilla-product-details

0 comments on commit 1f35535

Please sign in to comment.