From cd1bbc550185855646a7909d8bcf9469d46b644b Mon Sep 17 00:00:00 2001 From: Weimin Yu Date: Fri, 18 Oct 2019 11:48:40 -0400 Subject: [PATCH] Use base64-encoded SQL credentials (#314) * Use base64-encoded SQL credentials Encode Cloud SQL credential files on gcs with base64, to be consistent with our Cloud Build practices. Also renamed a property that specifies where to publish the schema jar. New name is schema_publish_repo. --- db/build.gradle | 5 +++-- gradle.properties | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/db/build.gradle b/db/build.gradle index 07a18d33c..f024e4984 100644 --- a/db/build.gradle +++ b/db/build.gradle @@ -94,6 +94,7 @@ ext { def command = """gsutil cp \ gs://domain-registry${env}-cloudsql-credentials/${role}_credential.enc - | \ + base64 -d | \ gcloud kms decrypt --location global --keyring nomulus \ --key sql-credentials-on-gcs-key --plaintext-file=- \ --ciphertext-file=- \ @@ -118,11 +119,11 @@ artifacts { publishing { repositories { maven { - url project.schema_jar_repo + url project.schema_publish_repo } } publications { - schemaOrmPublication(MavenPublication) { + sqlSchemaPublication(MavenPublication) { groupId 'google.registry' artifactId 'schema' version project.schema_version diff --git a/gradle.properties b/gradle.properties index 864eb9b3c..55bac8145 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,5 +24,5 @@ dbPassword= # Maven repository of the Cloud SQL schema jar, which contains the # SQL DDL scripts. -schema_jar_repo= +schema_publish_repo= schema_version=