Skip to content
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

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

Merged
merged 6 commits into from
Jul 5, 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
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ node_js:
- "node"
- "8"
- "6"
services:
- docker
script: npm run ci
notifications:
slack:
Expand All @@ -13,3 +15,10 @@ notifications:
rooms:
- secure: WDSJTf0kyen9YY7PH4PPc6LftE5w+YH825dX0qUF/3C+U4/qKW9D7U2z+bsbqi0Ir3cGObN6iK73O18E7N4L3vV1eyCj3ds7eyU9/YBroegz8+4KXw89n4lUVGo4jjIp9tzPgqmRdk5S0Flr/wc1HM9+VlnHFN5gE0P7Vui8bbc=
- secure: IlvaufTODSJPN3aIeQV4k/9c0YVRReCK4GAkBUj6Q9rMEJ9XQaSC3x5O0i1CM2cODWqfQsqVkII92LJy/Q8bbvIVW6ZYLy5aYi+EIiHAZMZkPb+kyIS97uDeYGL4Oo9OteGftNCIQTIpqu5WwWDx9cu9IoX9Qb19lO6chkCBo2I=
deploy:
provider: script
script: make docker-build && make docker-push
skip_cleanup: true
on:
tags: true
node: "8"
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:8

RUN mkdir /twilio
WORKDIR /twilio

ENV NODE_PATH /usr/local/lib/node_modules

COPY lib ./lib
COPY index.js .
COPY package* ./

RUN npm install . -g
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,14 @@ docs:

clean: node_modules
rm -rf node_modules

API_DEFINITIONS_SHA=$(shell git log --oneline | grep Regenerated | head -n1 | cut -d ' ' -f 5)
docker-build:
docker build -t twilio/twilio-node .
docker tag twilio/twilio-node twilio/twilio-node:${TRAVIS_TAG}
docker tag twilio/twilio-node twilio/twilio-node:apidefs-${API_DEFINITIONS_SHA}

docker-push:
echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
docker push twilio/twilio-node:${TRAVIS_TAG}
docker push twilio/twilio-node:apidefs-${API_DEFINITIONS_SHA}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ For detailed usage information and API docs, head out here:

[https://www.twilio.com/docs/libraries/node](https://www.twilio.com/docs/libraries/node)

## Docker Image

The `Dockerfile` present in this repository and its respective `twilio/twilio-node` Docker image are currently used by Twilio for testing purposes only.

## Getting help

If you need help installing or using the library, please contact Twilio Support at help@twilio.com first. Twilio's Support staff are well-versed in all of the Twilio Helper Libraries, and usually reply within 24 hours.
Expand Down