Skip to content

Commit

Permalink
Configure Heroku CI
Browse files Browse the repository at this point in the history
  • Loading branch information
SupraSummus committed Aug 30, 2024
1 parent 21b2cbe commit 5505320
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 54 deletions.
12 changes: 12 additions & 0 deletions 40-heroku.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,22 @@ cat > app.json <<EOL
"quantity": 1,
"size": "basic"
}
},
"environments": {
"test": {
"addons": ["heroku-postgresql:in-dyno"],
"scripts": {
"test-setup": "python manage.py collectstatic --no-input",
"test": "flake8 . && pytest"
}
}
}
}
EOL

# add heroku stuff to flake8 exclude
sed -i '/\[tool\.flake8\]/a exclude = [\n ".heroku",\n ".local",\n]' pyproject.toml

# Commit the changes
git add --all
git commit -m "Configure the project for Heroku deployment"
9 changes: 9 additions & 0 deletions example/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,14 @@
"quantity": 1,
"size": "basic"
}
},
"environments": {
"test": {
"addons": ["heroku-postgresql:in-dyno"],
"scripts": {
"test-setup": "python manage.py collectstatic --no-input",
"test": "flake8 . && pytest"
}
}
}
}
10 changes: 5 additions & 5 deletions example/commits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@
--- Install and configure Sentry

example/settings.py | 8 ++++++
poetry.lock | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
poetry.lock | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
pyproject.toml | 1 +
3 files changed, 89 insertions(+), 1 deletion(-)
3 files changed, 90 insertions(+), 1 deletion(-)

--- Configure the project for Heroku deployment

Procfile | 2 ++
app.json | 28 ++++++++++++++++++++++++++++
app.json | 37 +++++++++++++++++++++++++++++++++++++
poetry.lock | 23 ++++++++++++++++++++++-
pyproject.toml | 1 +
4 files changed, 53 insertions(+), 1 deletion(-)
pyproject.toml | 5 +++++
4 files changed, 66 insertions(+), 1 deletion(-)

--- Custom user model using UUID4 as the primary key

Expand Down
2 changes: 1 addition & 1 deletion example/example/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/
https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/
"""

import os
Expand Down
18 changes: 9 additions & 9 deletions example/example/settings.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""
Django settings for example project.
Generated by 'django-admin startproject' using Django 5.0.6.
Generated by 'django-admin startproject' using Django 5.1.
For more information on this file, see
https://docs.djangoproject.com/en/5.0/topics/settings/
https://docs.djangoproject.com/en/5.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.0/ref/settings/
https://docs.djangoproject.com/en/5.1/ref/settings/
"""

from pathlib import Path
Expand All @@ -23,7 +23,7 @@


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = env.str('SECRET_KEY')
Expand Down Expand Up @@ -79,15 +79,15 @@


# Database
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases

DATABASES = {
'default': env.db('DATABASE_URL')
}


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

AUTH_PASSWORD_VALIDATORS = [
{
Expand All @@ -106,7 +106,7 @@


# Internationalization
# https://docs.djangoproject.com/en/5.0/topics/i18n/
# https://docs.djangoproject.com/en/5.1/topics/i18n/

LANGUAGE_CODE = 'en-us'

Expand All @@ -118,12 +118,12 @@


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.0/howto/static-files/
# https://docs.djangoproject.com/en/5.1/howto/static-files/

STATIC_URL = 'static/'

# Default primary key field type
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

Expand Down
2 changes: 1 addition & 1 deletion example/example/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
URL configuration for example project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/5.0/topics/http/urls/
https://docs.djangoproject.com/en/5.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
Expand Down
2 changes: 1 addition & 1 deletion example/example/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/
https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/
"""

import os
Expand Down
75 changes: 38 additions & 37 deletions example/poetry.lock

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

4 changes: 4 additions & 0 deletions example/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.flake8]
exclude = [
".heroku",
".local",
]
ignore = [
"E501", # line too long
]
Expand Down

0 comments on commit 5505320

Please sign in to comment.