Skip to content

Commit

Permalink
feat: add timeout variable for cloudbuild builder (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
renato-rudnicki authored Dec 20, 2023
1 parent 2c0fd05 commit 380d48f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/tf_cloudbuild_builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ This module creates:
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| bucket\_name | Custom bucket name for Cloud Build logs. | `string` | `""` | no |
| build\_timeout | Amount of time the build should be allowed to run, to second granularity. Format is the number of seconds followed by s. | `string` | `"600s"` | no |
| cb\_logs\_bucket\_force\_destroy | When deleting the bucket for storing CloudBuild logs, this boolean option will delete all contained objects. If false, Terraform will fail to delete buckets which contain objects. | `bool` | `false` | no |
| cloudbuild\_sa | Custom SA email to be used by the CloudBuild trigger. Defaults to being created if empty. | `string` | `""` | no |
| dockerfile\_repo\_dir | The directory inside the repo where the Dockerfile is located. If empty defaults to repo root. | `string` | `""` | no |
Expand Down
1 change: 1 addition & 0 deletions modules/tf_cloudbuild_builder/cb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ resource "google_cloudbuild_trigger" "build_trigger" {

# todo(bharathkkb): switch to yaml after https://github.com/hashicorp/terraform-provider-google/issues/9818
build {
timeout = var.build_timeout
step {
name = "gcr.io/cloud-builders/docker"
args = concat(
Expand Down
6 changes: 6 additions & 0 deletions modules/tf_cloudbuild_builder/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ variable "cloudbuild_sa" {
default = ""
}

variable "build_timeout" {
description = "Amount of time the build should be allowed to run, to second granularity. Format is the number of seconds followed by s."
type = string
default = "600s"
}

variable "cb_logs_bucket_force_destroy" {
description = "When deleting the bucket for storing CloudBuild logs, this boolean option will delete all contained objects. If false, Terraform will fail to delete buckets which contain objects."
type = bool
Expand Down

0 comments on commit 380d48f

Please sign in to comment.