Skip to content

Commit 594131e

Browse files
author
Matt Bernier
authored
Merge pull request #35 from NdagiStanley/master
Add docker files and update README
2 parents 34c2628 + 769cb59 commit 594131e

File tree

5 files changed

+74
-0
lines changed

5 files changed

+74
-0
lines changed

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.pyc
2+
*.egg
3+
*.egg-info
4+
dist
5+
eggs
6+
build
7+
sdist
8+
.Python
9+
bin/
10+
include/
11+
lib/

Dockerfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
FROM ubuntu:xenial
2+
ENV PYTHON_VERSIONS='python2.6 python2.7 python3.4 python3.5 python3.6' \
3+
OAI_SPEC_URL="https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/oai_stoplight.json"
4+
5+
# install testing versions of python, including old versions, from deadsnakes
6+
RUN set -x \
7+
&& apt-get update \
8+
&& apt-get install -y --no-install-recommends software-properties-common \
9+
&& apt-add-repository -y ppa:fkrull/deadsnakes \
10+
&& apt-get update \
11+
&& apt-get install -y --no-install-recommends $PYTHON_VERSIONS \
12+
git \
13+
curl \
14+
&& apt-get purge -y --auto-remove software-properties-common \
15+
&& rm -rf /var/lib/apt/lists/*
16+
17+
WORKDIR /root
18+
19+
# install Prism
20+
ADD https://raw.githubusercontent.com/stoplightio/prism/master/install.sh install.sh
21+
RUN chmod +x ./install.sh && \
22+
./install.sh && \
23+
rm ./install.sh
24+
25+
# install pip, tox
26+
ADD https://bootstrap.pypa.io/get-pip.py get-pip.py
27+
RUN python2.7 get-pip.py && \
28+
pip install tox && \
29+
rm get-pip.py
30+
31+
# set up default sendgrid env
32+
WORKDIR /root/sources
33+
RUN git clone https://github.com/sendgrid/sendgrid-python.git && \
34+
git clone https://github.com/sendgrid/python-http-client.git
35+
WORKDIR /root
36+
RUN ln -s /root/sources/sendgrid-python/sendgrid && \
37+
ln -s /root/sources/python-http-client/python_http_client
38+
39+
COPY . .
40+
CMD sh run.sh

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ All updates to this module is documented in our [CHANGELOG](https://github.com/s
2121
- [Usage](#usage)
2222
- [Roadmap](#roadmap)
2323
- [How to Contribute](#contribute)
24+
- [Local set up](#local_setup)
2425
- [About](#about)
2526
- [License](#license)
2627

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

75+
<a name="local_setup"></a>
76+
77+
# Local Setup of the project
78+
79+
The simplest local development workflow is by using docker.
80+
81+
> Steps
82+
83+
1. Install Docker
84+
2. Run `docker-compose build` (This builds the container)
85+
3. Run `docker-compose up` (This runs tests by default)
86+
7487
<a name="about"></a>
7588
# About
7689

docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: '3'
2+
services:
3+
web:
4+
build: .
5+
volumes:
6+
- .:/root

run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
python2.7 setup.py install
4+
python2.7 test/__init__.py

0 commit comments

Comments
 (0)