Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPM-118 dbt platform deploy configuration #5339

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .copilot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
repository: data-hub-api
builder:
name: paketobuildpacks/builder-jammy-full
version: 0.3.339
43 changes: 43 additions & 0 deletions .copilot/image_build_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/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 ADMIN_OAUTH2_ENABLED="True"
export ADMIN_OAUTH2_BASE_URL=""
export ADMIN_OAUTH2_TOKEN_FETCH_PATH="/o/token/"
export ADMIN_OAUTH2_USER_PROFILE_PATH="/o/v1/user/me/"
export ADMIN_OAUTH2_AUTH_PATH="/o/authorize/"
export ADMIN_OAUTH2_CLIENT_ID="client-id"
export ADMIN_OAUTH2_CLIENT_SECRET="client-secret"
export ADMIN_OAUTH2_LOGOUT_PATH="/o/logout"
export ACTIVITY_STREAM_ACCESS_KEY_ID="some-id"
export ACTIVITY_STREAM_SECRET_ACCESS_KEY="some-secret"
export DATABASE_URL="postgresql://postgres:datahub@postgres/datahub"
export DEBUG="True"
export DJANGO_SECRET_KEY="changeme"
export DJANGO_SETTINGS_MODULE="config.settings.local"
export ES_INDEX_PREFIX="test_index"
export ES5_URL="http://localhost:9200"
export OPENSEARCH_URL="http://localhost:9200"
export OPENSEARCH_INDEX_PREFIX="test_index"
export PAAS_IP_ALLOWLIST="1.2.3.4"
export AWS_DEFAULT_REGION="eu-west-2"
export AWS_ACCESS_KEY_ID="foo"
export AWS_SECRET_ACCESS_KEY="bar"
export DEFAULT_BUCKET="baz"
export SSO_ENABLED="True"
export STAFF_SSO_BASE_URL="http://sso.invalid/"
export STAFF_SSO_AUTH_TOKEN="sso-token"
export DIT_EMAIL_DOMAINS="trade.gov.uk,digital.trade.gov.uk"
export DATA_HUB_FRONTEND_ACCESS_KEY_ID="frontend-key-id"
export DATA_HUB_FRONTEND_SECRET_ACCESS_KEY="frontend-key"
export ES_APM_ENABLED="False"
export ES_APM_SERVICE_NAME="datahub"
export ES_APM_SECRET_TOKEN=""
export ES_APM_SERVER_URL="http://localhost:8200"
export ES_APM_ENVIRONMENT="circleci"
export REDIS_BASE_URL="redis://localhost:6379"

python manage.py collectstatic --noinput
6 changes: 6 additions & 0 deletions .copilot/phases/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# Exit early if something goes wrong
set -e

# Add commands below to run as part of the build phase
6 changes: 6 additions & 0 deletions .copilot/phases/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# Exit early if something goes wrong
set -e

# Add commands below to run as part of the install phase
6 changes: 6 additions & 0 deletions .copilot/phases/post_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# Exit early if something goes wrong
set -e

# Add commands below to run as part of the post_build phase
6 changes: 6 additions & 0 deletions .copilot/phases/pre_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# Exit early if something goes wrong
set -e

# Add commands below to run as part of the pre_build phase
10 changes: 8 additions & 2 deletions web.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@ if [ -z "$SKIP_OPENSEARCH_MAPPING_MIGRATIONS" ] && [ "${CF_INSTANCE_INDEX:-0}" =
./manage.py migrate_search
fi

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