This file contains hidden or 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
| gcloud secrets create django_app_settings --replication-policy automatic | |
| gcloud secrets versions add django_app_settings --data-file .env.prod | |
| # Get the PROJECTNUM from your GCP project dashboard | |
| gcloud secrets add-iam-policy-binding django_app_settings \ | |
| --member serviceAccount:<PROJECTNUM>@cloudbuild.gserviceaccount.com \ | |
| --role roles/secretmanager.secretAccessor | |
| gcloud secrets describe django_app_settings |
This file contains hidden or 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
| # Update the settings.py file to use our newly created env variables. | |
| import io | |
| import os | |
| import environ | |
| import google.auth | |
| from google.cloud import secretmanager | |
| BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
This file contains hidden or 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
| steps: | |
| # 0. Docker Build | |
| - name: gcr.io/cloud-builders/docker | |
| args: | |
| - build | |
| - '--no-cache' | |
| - '-t' | |
| - '$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA' | |
| - . | |
| - '-f' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer