diff --git a/.travis.yml b/.travis.yml index a4d9a6faea..d8aeeaee73 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,3 +10,8 @@ install: - make test-install script: - make test +deploy: + script: + - make docker-build + - make docker-push + on: tags diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..6ec70d89d6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3.6 + +ENV PYTHONUNBUFFERED 1 + +RUN mkdir /twilio +WORKDIR /twilio + +COPY setup.py . +COPY requirements.txt . +COPY README.rst . +COPY twilio ./twilio + +RUN pip install . diff --git a/Makefile b/Makefile index 69dd2a8297..0dbfecd76e 100644 --- a/Makefile +++ b/Makefile @@ -45,3 +45,14 @@ clean: nopyc: find . -name \*.pyc -delete + +API_DEFINITIONS_SHA=$(shell git log --oneline | grep Regenerated | head -n1 | cut -d ' ' -f 5) +docker-build: + docker build -t twilio/twilio-python . + docker tag twilio/twilio-python twilio/twilio-python:${TRAVIS_TAG} + docker tag twilio/twilio-python twilio/twilio-python:apidefs-${API_DEFINITIONS_SHA} + +docker-push: + docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD} + docker push twilio/twilio-python:${TRAVIS_TAG} + docker push twilio/twilio-python:apidefs-${API_DEFINITIONS_TAG} diff --git a/README.rst b/README.rst index 988b9d3e5a..b5322a61e6 100644 --- a/README.rst +++ b/README.rst @@ -154,3 +154,8 @@ To control phone calls, your application needs to output Welcome to twilio! + +Docker Image +~~~~~~~~~~~~ + +The `Dockerfile` present in this repository and its respective `twilio/twilio-python` Docker image are currently used by Twilio for testing purposes only.