Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Fixes found while spinning up a new project #262

Merged
merged 7 commits into from
Aug 18, 2020
Merged

Conversation

icco
Copy link
Contributor

@icco icco commented Aug 18, 2020

Proposed Changes

  • Turn on debug logging for the migrate run by terraform on a new project
  • Prefix DB_PASSWORD for the migrate command with secret://

Release Note

Turns on debug logging when running the migrate command through terraform

@googlebot googlebot added the cla: yes Auto: added by CLA bot when all committers have signed a CLA. label Aug 18, 2020
@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: icco, mikehelmick

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-robot google-oss-robot merged commit 691f9f5 into google:main Aug 18, 2020
@@ -60,5 +60,5 @@ fi

gcloud builds submit "${ROOT}" \
--config "${ROOT}/builders/migrate.yaml" \
--substitutions "_DB_CONN=${DB_CONN},_DB_APIKEY_DATABASE_KEY=${DB_APIKEY_DATABASE_KEY},_DB_APIKEY_SIGNATURE_KEY=${DB_APIKEY_SIGNATURE_KEY},_DB_ENCRYPTION_KEY=${DB_ENCRYPTION_KEY},_DB_NAME=${DB_NAME},_DB_PASSWORD=${DB_PASSWORD},_DB_USER=${DB_USER}" \
--substitutions "_DB_CONN=${DB_CONN},_DB_APIKEY_DATABASE_KEY=${DB_APIKEY_DATABASE_KEY},_DB_APIKEY_SIGNATURE_KEY=${DB_APIKEY_SIGNATURE_KEY},_DB_ENCRYPTION_KEY=${DB_ENCRYPTION_KEY},_DB_NAME=${DB_NAME},_DB_PASSWORD=${DB_PASSWORD},_DB_USER=${DB_USER},_DB_DEBUG=${DB_DEBUG},_LOG_DEBUG=${LOG_DEBUG}" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really wish Cloud Build let you specify --substitutions multiple times to avoid this insanely long line...

@@ -233,14 +233,18 @@ resource "null_resource" "migrate" {
DB_CONN = google_sql_database_instance.db-inst.connection_name
DB_ENCRYPTION_KEY = google_kms_crypto_key.database-encrypter.self_link
DB_NAME = google_sql_database.db.name
DB_PASSWORD = google_secret_manager_secret_version.db-secret-version["password"].name
DB_PASSWORD = "secret://${google_secret_manager_secret_version.db-secret-version["password"].id}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmmmm.... this change is correct, but how did it work before?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was puzzling me too. But it was late and I was all shrugs. Maybe no one has run this step in a long time?

@icco icco deleted the debug branch August 18, 2020 13:24
@google google locked and limited conversation to collaborators Oct 6, 2020
@icco icco restored the debug branch October 6, 2020 20:52
@icco icco deleted the debug branch October 6, 2020 21:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Auto: added by CLA bot when all committers have signed a CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants