Skip to content

Commit

Permalink
Merge pull request #41 from NandosUK/cloud-build-location
Browse files Browse the repository at this point in the history
cloud build location var
  • Loading branch information
audronFS authored Dec 12, 2023
2 parents b96ab7a + e1070f2 commit 802e136
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions gcp/cloud-cloudbuild-trigger/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resource "google_cloudbuild_trigger" "trigger_main" {
description = var.description
tags = var.tags
name = var.name
location = var.location
github {
owner = var.repository_owner
name = var.repository_name
Expand Down
6 changes: 6 additions & 0 deletions gcp/cloud-cloudbuild-trigger/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ variable "description" {
description = "The description of the Cloud Build trigger."
}

variable "location" {
type = string
default = null
description = "The location of the Cloud Build trigger. If not specify, the default location will be global."
}

# Filename of the build configuration
variable "filename" {
type = string
Expand Down
1 change: 1 addition & 0 deletions gcp/cloud-function-gen2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ module "trigger_provision" {
name = "function-${var.function_name}-provision"
description = "Provision ${var.function_name} Service (CI/CD)"
source = "../cloud-cloudbuild-trigger"
location = var.location
filename = var.function_path == "" ? "services/${var.service_name}/functions/${var.function_name}/cloudbuild.yaml" : "${var.function_path}/cloudbuild.yaml"
include = var.function_path == "" ? ["services/${var.service_name}/functions/${var.function_name}/**"] : ["${var.function_path}/**"]
tags = ["function"]
Expand Down
6 changes: 6 additions & 0 deletions gcp/cloud-function-gen2/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ variable "project_id" {
type = string
}

variable "location" {
description = "Cloud build trigger location. If not specified, the default location will be global."
type = string
default = null
}

variable "trigger_config" {
description = "Configuration for the Cloud Build Trigger"
type = object({
Expand Down
1 change: 1 addition & 0 deletions gcp/cloud-run-v2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ module "trigger_provision" {
source = "../cloud-cloudbuild-trigger"
name = "service-${var.name}-provision"
repository_name = var.repository_name
location = var.location
description = "Provision ${var.name} Service (CI/CD)"
filename = "${var.service_path}/cloudbuild.yaml"
include = concat(["${var.service_path}/**"], var.dependencies)
Expand Down
5 changes: 5 additions & 0 deletions gcp/cloud-run-v2/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ variable "service_path" {
type = string
}

variable "location" {
description = "Cloud build trigger location. If not specified, the default location will be global."
type = string
default = null
}

variable "trigger_config" {
description = "Configuration for the Cloud Build Trigger"
Expand Down

0 comments on commit 802e136

Please sign in to comment.