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

Move liquidbase.properties off local machine. #239

Merged
merged 1 commit into from
Mar 12, 2024
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: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ platform/agones/skaffold.yaml
**/global-game-*/agones-system.yaml
platform/open-match/base/kustomization.yaml

# Ignore Terraform generated liquibase files
infrastructure/schema/liquibase.properties
# Ignore any tmp files generated
infrastructure/tmp

# Ignore go.work, go.work.sum (results of `go work`)
go.work
Expand Down
4 changes: 4 additions & 0 deletions infrastructure/schema/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
serviceAccount: projects/${PROJECT_ID}/serviceAccounts/cloudbuild-cicd@${PROJECT_ID}.iam.gserviceaccount.com
steps:

- name: gcr.io/cloud-builders/gcloud
id: download schema file
args: ["storage", "cp", "gs://${PROJECT_ID}-spanner-schema/liquibase.properties", "."]

#
# Building of schema image
#
Expand Down
14 changes: 13 additions & 1 deletion infrastructure/spanner.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,17 @@ resource "local_file" "liquibase-properties" {
instance_id = google_spanner_instance.global-game-spanner.name
database_id = google_spanner_database.spanner-database.name
})
filename = "${path.module}/${var.schema_directory}/liquibase.properties"
filename = "${path.module}/tmp/liquibase.properties"
}

# Store the file in GCS as our source of truth for where our database is.
resource "google_storage_bucket" "spanner-schema" {
location = "US"
name = "${var.project}-spanner-schema"
}

resource "google_storage_bucket_object" "upload-spanner-schema" {
name = "liquibase.properties"
bucket = google_storage_bucket.spanner-schema.name
source = local_file.liquibase-properties.filename
}