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

Skip to content

Add Dockerfile and related changes to build the Docker image #428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ install:
- make test-install
script:
- make test
deploy:
script:
- make docker-build
- make docker-push
on: tags
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 .
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a prefix like apidefs to this to distinguish it from other SHA's?

Copy link
Contributor Author

@jonatasbaldin jonatasbaldin Jun 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so.. what do you think about twilio/twilio-python:apidefs-<sha>?

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}
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,8 @@ To control phone calls, your application needs to output

<?xml version="1.0" encoding="utf-8"?>
<Response><Say>Welcome to twilio!</Say></Response>

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.