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

feat: Add docker files and update README #35

Merged
merged 3 commits into from
Oct 29, 2017
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
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*.pyc
*.egg
*.egg-info
dist
eggs
build
sdist
.Python
bin/
include/
lib/
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM ubuntu:xenial
ENV PYTHON_VERSIONS='python2.6 python2.7 python3.4 python3.5 python3.6' \
OAI_SPEC_URL="https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/oai_stoplight.json"

# install testing versions of python, including old versions, from deadsnakes
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends software-properties-common \
&& apt-add-repository -y ppa:fkrull/deadsnakes \
&& apt-get update \
&& apt-get install -y --no-install-recommends $PYTHON_VERSIONS \
git \
curl \
&& apt-get purge -y --auto-remove software-properties-common \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /root

# install Prism
ADD https://raw.githubusercontent.com/stoplightio/prism/master/install.sh install.sh
RUN chmod +x ./install.sh && \
./install.sh && \
rm ./install.sh

# install pip, tox
ADD https://bootstrap.pypa.io/get-pip.py get-pip.py
RUN python2.7 get-pip.py && \
pip install tox && \
rm get-pip.py

# set up default sendgrid env
WORKDIR /root/sources
RUN git clone https://github.com/sendgrid/sendgrid-python.git && \
git clone https://github.com/sendgrid/python-http-client.git
WORKDIR /root
RUN ln -s /root/sources/sendgrid-python/sendgrid && \
ln -s /root/sources/python-http-client/python_http_client

COPY . .
CMD sh run.sh
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ All updates to this module is documented in our [CHANGELOG](https://github.com/s
- [Usage](#usage)
- [Roadmap](#roadmap)
- [How to Contribute](#contribute)
- [Local set up](#local_setup)
- [About](#about)
- [License](#license)

Expand Down Expand Up @@ -71,6 +72,18 @@ Quick links:
- [Sign the CLA to Create a Pull Request](https://github.com/sendgrid/smtpapi-python/blob/master/CONTRIBUTING.md#cla)
- [Improvements to the Codebase](https://github.com/sendgrid/smtpapi-python/blob/master/CONTRIBUTING.md#improvements-to-the-codebase)

<a name="local_setup"></a>

# Local Setup of the project

The simplest local development workflow is by using docker.

> Steps

1. Install Docker
2. Run `docker-compose build` (This builds the container)
3. Run `docker-compose up` (This runs tests by default)

<a name="about"></a>
# About

Expand Down
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: '3'
services:
web:
build: .
volumes:
- .:/root
4 changes: 4 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

python2.7 setup.py install
python2.7 test/__init__.py