Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7de794d

Browse files
Jonatas Baldincjcodes
authored andcommitted
Add Dockerfile and related changes to build the Docker image (twilio#428)
1 parent 893fb41 commit 7de794d

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ install:
1010
- make test-install
1111
script:
1212
- make test
13+
deploy:
14+
script:
15+
- make docker-build
16+
- make docker-push
17+
on: tags

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM python:3.6
2+
3+
ENV PYTHONUNBUFFERED 1
4+
5+
RUN mkdir /twilio
6+
WORKDIR /twilio
7+
8+
COPY setup.py .
9+
COPY requirements.txt .
10+
COPY README.rst .
11+
COPY twilio ./twilio
12+
13+
RUN pip install .

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,14 @@ clean:
4545

4646
nopyc:
4747
find . -name \*.pyc -delete
48+
49+
API_DEFINITIONS_SHA=$(shell git log --oneline | grep Regenerated | head -n1 | cut -d ' ' -f 5)
50+
docker-build:
51+
docker build -t twilio/twilio-python .
52+
docker tag twilio/twilio-python twilio/twilio-python:${TRAVIS_TAG}
53+
docker tag twilio/twilio-python twilio/twilio-python:apidefs-${API_DEFINITIONS_SHA}
54+
55+
docker-push:
56+
docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}
57+
docker push twilio/twilio-python:${TRAVIS_TAG}
58+
docker push twilio/twilio-python:apidefs-${API_DEFINITIONS_TAG}

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,8 @@ To control phone calls, your application needs to output
154154
155155
<?xml version="1.0" encoding="utf-8"?>
156156
<Response><Say>Welcome to twilio!</Say></Response>
157+
158+
Docker Image
159+
~~~~~~~~~~~~
160+
161+
The `Dockerfile` present in this repository and its respective `twilio/twilio-python` Docker image are currently used by Twilio for testing purposes only.

0 commit comments

Comments
 (0)