Skip to content

Commit

Permalink
Adds to cloudbuild trigger resource in order to support github enterp…
Browse files Browse the repository at this point in the history
…rise triggers
  • Loading branch information
Mario Machado committed Feb 6, 2023
1 parent 72c5102 commit 7747645
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mmv1/products/cloudbuild/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,11 @@ objects:
exactly_one_of:
- github.0.push.0.branch
- github.0.push.0.tag
- !ruby/object:Api::Type::String
name: 'enterpriseConfigResourceName'
description: |
The resource name of the github enterprise config that should be applied to this installation.
For example: "projects/{$projectId}/locations/{$locationId}/githubEnterpriseConfigs/{$configId}"
- !ruby/object:Api::Type::NestedObject
name: 'pubsubConfig'
description: |
Expand Down
4 changes: 4 additions & 0 deletions mmv1/products/cloudbuild/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ overrides: !ruby/object:Overrides::ResourceOverrides
installation_id: 31300675
pat_secret: '"projects/gcb-terraform-creds/secrets/github-pat/versions/latest"'
repo_uri: '"https://github.com/gcb-repos-robot/tf-demo.git"'
- !ruby/object:Provider::Terraform::Examples
name: "cloudbuild_trigger_github_enterprise"
primary_resource_id: "ghe-trigger"
skip_test: true

properties:
id: !ruby/object:Overrides::Terraform::PropertyOverride
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resource "google_cloudbuild_trigger" "<%= ctx[:primary_resource_id] %>" {
name = "terraform-ghe-trigger"
location = "us-central1"

github {
owner = "hashicorp"
name = "terraform-provider-google"
push {
branch = "^main$"
}
enterprise_config_resource_name = "projects/123456789/locations/us-central1/githubEnterpriseConfigs/configID"
}

filename = "cloudbuild.yaml"
}

0 comments on commit 7747645

Please sign in to comment.