Skip to content

Commit

Permalink
add wait propagation after connection creation
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-cit committed Oct 24, 2024
1 parent ee6523f commit 120090b
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 2 deletions.
11 changes: 11 additions & 0 deletions examples/tf_cloudbuild_builder_simple_github/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ module "cloudbuilder" {

# allow logs bucket to be destroyed
cb_logs_bucket_force_destroy = true

depends_on = [time_sleep.wait_propagation]
}

resource "time_sleep" "wait_propagation" {
create_duration = "30s"

depends_on = [
google_cloudbuildv2_repository.repository_connection,
google_cloudbuildv2_connection.vcs_connection,
]
}

// Create a secret containing the personal access token and grant permissions to the Service Agent.
Expand Down
17 changes: 17 additions & 0 deletions examples/tf_cloudbuild_builder_simple_gitlab/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,25 @@ module "cloudbuilder" {

# allow logs bucket to be destroyed
cb_logs_bucket_force_destroy = true

depends_on = [
module.enabled_google_apis,
time_sleep.wait_propagation,
]
}


resource "time_sleep" "wait_propagation" {
create_duration = "30s"

depends_on = [
google_cloudbuildv2_repository.repository_connection,
google_cloudbuildv2_connection.vcs_connection,
]
}



// Create a secret containing the personal access token and grant permissions to the Service Agent.
resource "google_secret_manager_secret" "gitlab_api_secret" {
project = var.project_id
Expand Down
14 changes: 13 additions & 1 deletion examples/tf_cloudbuild_workspace_simple_github/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,22 @@ module "tf_workspace" {
}
cloudbuild_env_vars = ["TF_VAR_project_id=${var.project_id}"]

depends_on = [module.enabled_google_apis]
depends_on = [
module.enabled_google_apis,
time_sleep.wait_propagation,
]
}


resource "time_sleep" "wait_propagation" {
create_duration = "30s"

depends_on = [
google_cloudbuildv2_repository.repository_connection,
google_cloudbuildv2_connection.vcs_connection,
]
}

// Create a secret containing the personal access token and grant permissions to the Service Agent.
resource "google_secret_manager_secret" "github_token_secret" {
project = var.project_id
Expand Down
15 changes: 14 additions & 1 deletion examples/tf_cloudbuild_workspace_simple_gitlab/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,20 @@ module "tf_workspace" {
}
cloudbuild_env_vars = ["TF_VAR_project_id=${var.project_id}"]

depends_on = [module.enabled_google_apis]
depends_on = [
module.enabled_google_apis,
time_sleep.wait_propagation,
]
}


resource "time_sleep" "wait_propagation" {
create_duration = "30s"

depends_on = [
google_cloudbuildv2_repository.repository_connection,
google_cloudbuildv2_connection.vcs_connection,
]
}

// Create a secret containing the personal access token and grant permissions to the Service Agent.
Expand Down

0 comments on commit 120090b

Please sign in to comment.