Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Migration deploy build config #914

Merged
merged 12 commits into from
May 8, 2024
4 changes: 4 additions & 0 deletions .copilot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
repository: emt
builder:
name: paketobuildpacks/builder-jammy-full
version: 0.3.339
12 changes: 12 additions & 0 deletions .copilot/image_build_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

# Exit early if something goes wrong
set -e

# Add commands below to run inside the container after all the other buildpacks have been applied

export DJANGO_SECRET_KEY="build-time-secret"
export DEBUG="False"
export FEATURE_ENFORCE_STAFF_SSO_ENABLED="False"

python manage.py collectstatic --noinput
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
web: ./web.sh
web: bash web.sh
celery: celery -A app worker -l info
celerybeat: celery -A app beat -l info
16 changes: 8 additions & 8 deletions app/settings/common.py
Original file line number Diff line number Diff line change
@@ -68,14 +68,14 @@
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# Configure Sentry
DJANGO_SENTRY_DSN = env('DJANGO_SENTRY_DSN')
sentry_sdk.init(
dsn=DJANGO_SENTRY_DSN,
integrations=[
CeleryIntegration(),
DjangoIntegration(),
],
)
if DJANGO_SENTRY_DSN := env.str('DJANGO_SENTRY_DSN', default=False):
sentry_sdk.init(
dsn=DJANGO_SENTRY_DSN,
integrations=[
CeleryIntegration(),
DjangoIntegration(),
],
)

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,9 @@
"test": "cypress open --browser chrome --e2e",
"sass": "sass sass/application.scss app/enquiries/static/application.css",
"sass:watch": "npm run sass -- --watch",
"postinstall": "npm run sass"
"postinstall": "npm run sass",
"start": "echo start",
"build": "echo build"
},
"repository": {
"type": "git",
@@ -31,5 +33,8 @@
"overrides": {
"glob-parent": "6.0.1",
"tough-cookie": "4.1.3"
},
"engines": {
"node": "20.11"
}
}
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.12.0
python-3.12.x
8 changes: 7 additions & 1 deletion web.sh
Original file line number Diff line number Diff line change
@@ -5,6 +5,12 @@
set -xe

./manage.py migrate --noinput
./manage.py collectstatic --noinput

if [ -n "${COPILOT_ENVIRONMENT_NAME}" ]; then
echo "Running in DBT Platform"
else
echo "Running in Cloud Foundry"
python manage.py collectstatic --noinput
fi

gunicorn app.wsgi --config app/gunicorn.py