Skip to content

Commit

Permalink
Mailer version 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rclement committed Dec 21, 2018
2 parents e598093 + 03d7078 commit 11f5bcd
Show file tree
Hide file tree
Showing 23 changed files with 1,374 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*
!mailer
!now.json
!Pipfile
!Pipfile.lock
!Procfile
11 changes: 11 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FLASK_APP = 'mailer.wsgi:application'
FLASK_ENV = 'development'
SERVER_NAME = 'localhost:5000'
PREFERRED_URL_SCHEME = 'http'
SECRET_KEY = 'secret'
TO_EMAIL = 'me@domain.com'
TO_NAME = 'Me'
CORS_ORIGINS = 'https://domain.com'
MAILER_SERVICE = 'sendgrid'
SENDGRID_API_KEY = 'key'
SENDGRID_SANDBOX = 'false'
31 changes: 24 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ __pycache__/

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
Expand All @@ -23,7 +24,6 @@ wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
Expand All @@ -45,7 +45,6 @@ nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
Expand All @@ -54,7 +53,6 @@ coverage.xml
# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
Expand All @@ -81,14 +79,13 @@ celerybeat-schedule
# SageMath parsed files
*.sage.py

# Environments
# dotenv
.env

# virtualenv
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
Expand All @@ -102,3 +99,23 @@ venv.bak/

# mypy
.mypy_cache/

# pytest
.pytest_cache/

# Sphinx documentation
docs/_build/

# OS generated files #
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# IDEs and editors
.idea/
.vscode/
*.swp
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
dist: xenial

language: python
python:
- "3.7"

services:
- docker

install:
- pip install pipenv coveralls
- pipenv install --dev

script:
- pipenv run inv qa
- pipenv run coveralls

deploy:
- provider: script
script: pipenv run inv docker-deploy -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" -r "mailer" -t "$TRAVIS_TAG"
on:
tags: true
- provider: script
script: pipenv run inv docker-deploy -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" -r "mailer" -t "latest"
on:
tags: false
all_branches: true
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM python:3.7-alpine

RUN set -ex && pip install --upgrade pip && pip install pipenv

WORKDIR /app

COPY Pipfile Pipfile
COPY Pipfile.lock Pipfile.lock

RUN set -ex \
&& apk add --virtual .build-deps build-base gcc python-dev libffi-dev \
&& pipenv install --deploy --system \
&& apk del .build-deps

COPY . /app

EXPOSE 5000

ENTRYPOINT ["honcho", "start"]
CMD ["web"]
32 changes: 32 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[packages]
flask = "*"
flask-apispec = "*"
flask-cors = "*"
flask-limiter = "*"
flask-talisman = "*"
gevent = "*"
gunicorn = "*"
honcho = "*"
sendgrid = "*"

[dev-packages]
black = "*"
"flake8" = "*"
invoke = "*"
pytest = "*"
pytest-cov = "*"
pytest-flask = "*"
pytest-mock = "*"
python-dotenv = "*"
safety = "*"

[requires]
python_version = "3.7"

[pipenv]
allow_prereleases = true
Loading

0 comments on commit 11f5bcd

Please sign in to comment.