-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from willianantunes/release/heroku-qa
Fresh new release with Heroku support
- Loading branch information
Showing
13 changed files
with
325 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
FROM python:3.7.3-slim-stretch | ||
|
||
# In order to have OUTPUT from Heroku | ||
RUN apt-get update && apt-get install curl -y | ||
|
||
RUN groupadd --system app-user && adduser --system --ingroup app-user app-user | ||
|
||
WORKDIR /app | ||
|
||
COPY . /app | ||
COPY --chown=app-user:app-user . /app | ||
|
||
RUN python -m pip install --upgrade pip && \ | ||
pip install pipenv && \ | ||
pipenv install --system --deploy --ignore-pipfile | ||
|
||
USER app-user | ||
|
||
CMD gunicorn -cfile:gunicorn_config.ini -b 0.0.0.0:${PORT} django_graphql_playground.wsgi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
############ | ||
###### http://docs.gunicorn.org/en/stable/settings.html#worker-processes | ||
|
||
workers = 5 | ||
worker_class = "gevent" | ||
worker_connections = 1000 | ||
timeout = 30 | ||
keepalive = 2 | ||
|
||
############ | ||
###### http://docs.gunicorn.org/en/stable/settings.html#logging | ||
|
||
errorlog = "-" | ||
loglevel = "info" | ||
accesslog = "-" | ||
access_log_format = '{"message": "%(r)s", "http_status": %(s)s, "ip_address": "%(h)s", "response_length": "%(b)s", "referer": "%(f)s", "user_agent": "%(a)s", "request_time": %(L)s, "date": "%(t)s"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
build: | ||
docker: | ||
web: Dockerfile | ||
release: | ||
image: web | ||
command: | ||
- ./release-task.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
python manage.py makemigrations | ||
python manage.py migrate | ||
python manage.py seed_db --create-super-user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import os | ||
import re | ||
from dataclasses import dataclass | ||
from datetime import date | ||
from datetime import timedelta | ||
|
||
from dateutil import relativedelta | ||
|
||
from django_graphql_playground.support import utils | ||
|
||
|
||
def test_should_extract_db_properties_given_url(): | ||
result = utils.extract_db_properties_from_url( | ||
"postgres://czazgirubdxrxw:8d5d635df6f2a226b1a1f81541cfcd20fadf8617fff383f553e39330392de901@ec2-54-243-47-196.compute-1.amazonaws.com:5432/dau6saplk4ri6e" | ||
) | ||
assert result.target == "postgres" | ||
assert result.user == "czazgirubdxrxw" | ||
assert result.password == "8d5d635df6f2a226b1a1f81541cfcd20fadf8617fff383f553e39330392de901" | ||
assert result.hostname == "ec2-54-243-47-196.compute-1.amazonaws.com" | ||
assert result.port == "5432" | ||
assert result.database_name == "dau6saplk4ri6e" |