From ab450292d4cbe79463bc82e644fb5830eb13836e Mon Sep 17 00:00:00 2001 From: Philippe Boneff Date: Wed, 9 Apr 2025 16:23:38 +0000 Subject: [PATCH 1/2] rename staging dir to arche2025h1 # Conflicts: # deployment/live/gcp/static-ct-staging/cloudbuild/arche2025h1/terragrunt.hcl # Conflicts: # deployment/live/gcp/static-ct-staging/cloudbuild/arche2025h1/terragrunt.hcl --- .../.terraform.lock.hcl | 0 .../cloudbuild/{ => arche2025h1}/README.md | 0 .../cloudbuild/arche2025h1/terragrunt.hcl | 21 +++++++++++++++ .../cloudbuild/staging/terragrunt.hcl | 13 ---------- .../cloudbuild/terragrunt.hcl | 26 ------------------- .../logs/arche2025h1/README.md | 2 +- 6 files changed, 22 insertions(+), 40 deletions(-) rename deployment/live/gcp/static-ct-staging/cloudbuild/{staging => arche2025h1}/.terraform.lock.hcl (100%) rename deployment/live/gcp/static-ct-staging/cloudbuild/{ => arche2025h1}/README.md (100%) create mode 100644 deployment/live/gcp/static-ct-staging/cloudbuild/arche2025h1/terragrunt.hcl delete mode 100644 deployment/live/gcp/static-ct-staging/cloudbuild/staging/terragrunt.hcl delete mode 100644 deployment/live/gcp/static-ct-staging/cloudbuild/terragrunt.hcl diff --git a/deployment/live/gcp/static-ct-staging/cloudbuild/staging/.terraform.lock.hcl b/deployment/live/gcp/static-ct-staging/cloudbuild/arche2025h1/.terraform.lock.hcl similarity index 100% rename from deployment/live/gcp/static-ct-staging/cloudbuild/staging/.terraform.lock.hcl rename to deployment/live/gcp/static-ct-staging/cloudbuild/arche2025h1/.terraform.lock.hcl diff --git a/deployment/live/gcp/static-ct-staging/cloudbuild/README.md b/deployment/live/gcp/static-ct-staging/cloudbuild/arche2025h1/README.md similarity index 100% rename from deployment/live/gcp/static-ct-staging/cloudbuild/README.md rename to deployment/live/gcp/static-ct-staging/cloudbuild/arche2025h1/README.md diff --git a/deployment/live/gcp/static-ct-staging/cloudbuild/arche2025h1/terragrunt.hcl b/deployment/live/gcp/static-ct-staging/cloudbuild/arche2025h1/terragrunt.hcl new file mode 100644 index 00000000..12d992c6 --- /dev/null +++ b/deployment/live/gcp/static-ct-staging/cloudbuild/arche2025h1/terragrunt.hcl @@ -0,0 +1,21 @@ +terraform { + source = "${get_repo_root()}/deployment/modules/gcp//cloudbuild/preloaded" +} + +locals { + env = get_env("GOOGLE_ENV", "staging") + docker_env = get_env("GOOGLE_ENV", "staging") + project_id = get_env("GOOGLE_PROJECT", "static-ct-staging") + location = get_env("GOOGLE_REGION", "us-central1") + github_owner = get_env("GITHUB_OWNER", "transparency-dev") +} + +include "root" { + path = find_in_parent_folders() + expose = true +} + +inputs = merge( + local, + include.root.locals, +) diff --git a/deployment/live/gcp/static-ct-staging/cloudbuild/staging/terragrunt.hcl b/deployment/live/gcp/static-ct-staging/cloudbuild/staging/terragrunt.hcl deleted file mode 100644 index bfe38813..00000000 --- a/deployment/live/gcp/static-ct-staging/cloudbuild/staging/terragrunt.hcl +++ /dev/null @@ -1,13 +0,0 @@ -locals { - docker_env = include.root.locals.env -} - -include "root" { - path = find_in_parent_folders() - expose = true -} - -inputs = merge( - local, - include.root.locals, -) diff --git a/deployment/live/gcp/static-ct-staging/cloudbuild/terragrunt.hcl b/deployment/live/gcp/static-ct-staging/cloudbuild/terragrunt.hcl deleted file mode 100644 index 36d8a775..00000000 --- a/deployment/live/gcp/static-ct-staging/cloudbuild/terragrunt.hcl +++ /dev/null @@ -1,26 +0,0 @@ -terraform { - source = "${get_repo_root()}/deployment/modules/gcp//cloudbuild/preloaded" -} - -locals { - env = path_relative_to_include() - project_id = get_env("GOOGLE_PROJECT", "static-ct-staging") - location = get_env("GOOGLE_REGION", "us-central1") - github_owner = get_env("GITHUB_OWNER", "transparency-dev") -} - -remote_state { - backend = "gcs" - - config = { - project = local.project_id - location = local.location - bucket = "${local.project_id}-cloudbuild-terraform-state" - prefix = "terraform.tfstate" - - gcs_bucket_labels = { - name = "terraform_state" - env = "${local.env}" - } - } -} diff --git a/deployment/live/gcp/static-ct-staging/logs/arche2025h1/README.md b/deployment/live/gcp/static-ct-staging/logs/arche2025h1/README.md index afc36421..894564b8 100644 --- a/deployment/live/gcp/static-ct-staging/logs/arche2025h1/README.md +++ b/deployment/live/gcp/static-ct-staging/logs/arche2025h1/README.md @@ -25,7 +25,7 @@ awk \ ### Automatic Deployment -This GCP SCTFE preloaded staging environment is designed to be deployed by the Cloud Build ([Terraform module](/deployment/modules/gcp/cloudbuild/preloaded/), [Terragrunt configuration](/deployment/live/gcp/static-ct-staging/cloudbuild/staging/)). +This GCP SCTFE preloaded staging environment is designed to be deployed by the Cloud Build ([Terraform module](/deployment/modules/gcp/cloudbuild/preloaded/), [Terragrunt configuration](/deployment/live/gcp/static-ct-staging/cloudbuild/arche2025h1/)). ### Manual Deployment TODO(phboneff): come back to this, Cloud Run doesn't trigger a deployment if the tag does not change value. From b1f246c729b75129510c1728be513ecd1c1a1da5 Mon Sep 17 00:00:00 2001 From: Philippe Boneff Date: Wed, 9 Apr 2025 16:25:37 +0000 Subject: [PATCH 2/2] rename cloudbuild/preloaded to tesseract # Conflicts: # deployment/modules/gcp/cloudbuild/tesseract/variables.tf --- .../cloudbuild/arche2025h1/terragrunt.hcl | 25 +++++++++++++------ .../logs/arche2025h1/README.md | 2 +- .../{preloaded => tesseract}/main.tf | 0 .../{preloaded => tesseract}/variables.tf | 0 4 files changed, 18 insertions(+), 9 deletions(-) rename deployment/modules/gcp/cloudbuild/{preloaded => tesseract}/main.tf (100%) rename deployment/modules/gcp/cloudbuild/{preloaded => tesseract}/variables.tf (100%) diff --git a/deployment/live/gcp/static-ct-staging/cloudbuild/arche2025h1/terragrunt.hcl b/deployment/live/gcp/static-ct-staging/cloudbuild/arche2025h1/terragrunt.hcl index 12d992c6..9a4e4025 100644 --- a/deployment/live/gcp/static-ct-staging/cloudbuild/arche2025h1/terragrunt.hcl +++ b/deployment/live/gcp/static-ct-staging/cloudbuild/arche2025h1/terragrunt.hcl @@ -1,5 +1,5 @@ terraform { - source = "${get_repo_root()}/deployment/modules/gcp//cloudbuild/preloaded" + source = "${get_repo_root()}/deployment/modules/gcp//cloudbuild/tesseract" } locals { @@ -10,12 +10,21 @@ locals { github_owner = get_env("GITHUB_OWNER", "transparency-dev") } -include "root" { - path = find_in_parent_folders() - expose = true +inputs = local + +remote_state { + backend = "gcs" + + config = { + project = local.project_id + location = local.location + bucket = "${local.project_id}-cloudbuild-terraform-state" + prefix = "terraform.tfstate" + + gcs_bucket_labels = { + name = "terraform_state" + env = "${local.env}" + } + } } -inputs = merge( - local, - include.root.locals, -) diff --git a/deployment/live/gcp/static-ct-staging/logs/arche2025h1/README.md b/deployment/live/gcp/static-ct-staging/logs/arche2025h1/README.md index 894564b8..d9ce0c23 100644 --- a/deployment/live/gcp/static-ct-staging/logs/arche2025h1/README.md +++ b/deployment/live/gcp/static-ct-staging/logs/arche2025h1/README.md @@ -25,7 +25,7 @@ awk \ ### Automatic Deployment -This GCP SCTFE preloaded staging environment is designed to be deployed by the Cloud Build ([Terraform module](/deployment/modules/gcp/cloudbuild/preloaded/), [Terragrunt configuration](/deployment/live/gcp/static-ct-staging/cloudbuild/arche2025h1/)). +This GCP SCTFE preloaded staging environment is designed to be deployed by the Cloud Build ([Terraform module](/deployment/modules/gcp/cloudbuild/tesseract/), [Terragrunt configuration](/deployment/live/gcp/static-ct-staging/cloudbuild/arche2025h1/)). ### Manual Deployment TODO(phboneff): come back to this, Cloud Run doesn't trigger a deployment if the tag does not change value. diff --git a/deployment/modules/gcp/cloudbuild/preloaded/main.tf b/deployment/modules/gcp/cloudbuild/tesseract/main.tf similarity index 100% rename from deployment/modules/gcp/cloudbuild/preloaded/main.tf rename to deployment/modules/gcp/cloudbuild/tesseract/main.tf diff --git a/deployment/modules/gcp/cloudbuild/preloaded/variables.tf b/deployment/modules/gcp/cloudbuild/tesseract/variables.tf similarity index 100% rename from deployment/modules/gcp/cloudbuild/preloaded/variables.tf rename to deployment/modules/gcp/cloudbuild/tesseract/variables.tf