Skip to content

Commit

Permalink
Add support for Heroku CI
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmior committed Aug 30, 2020
1 parent 8729867 commit c18efe0
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 40 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "pypi"
dj-database-url = "*"
django = "==2.2.13"
django-grappelli = "*"
elasticsearch = "*"
elasticsearch = "==7.9.1"
gunicorn = "*"
newrelic = "*"
pyuploadcare = "*"
Expand Down
90 changes: 51 additions & 39 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,22 @@
"rollbar:free"
],
"scripts": {
"test": "sh -c 'python manage.py collectstatic && python manage.py test pylinks'",
"test-setup": "sh -c 'pip install whoosh && python manage.py migrate && python manage.py collectstatic --noinput'",
"postdeploy": "sh -c 'python manage.py migrate --noinput; python manage.py collectstatic --noinput'"
},
"environments": {
"test": {
"env": {
"DJANGO_DEBUG": 1,
"UPLOADCARE_DISABLED": 1,
"ROLLBAR_DISABLED": 1,
"DJANGO_SECRET_KEY": "foo",
"HOSTNAMES": "localhost"
},
"addons": [
"heroku-postgresql:in-dyno"
]
}
}
}
7 changes: 7 additions & 0 deletions pylinks/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
}
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'

# Use Whoosh on Heroku
if 'HEROKU_TEST_RUN_ID' in os.environ:
HAYSTACK_CONNECTIONS['default'] = {
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
'PATH': os.path.join(os.path.dirname(__file__), 'whoosh_index'),
}

# Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators

Expand Down

0 comments on commit c18efe0

Please sign in to comment.