Skip to content

Commit

Permalink
Adds field bitbucket_server_config to Trigger.git_file_source and Tri…
Browse files Browse the repository at this point in the history
…gger.source_to_build, supporting manual, pub/sub and webhook triggers. (GoogleCloudPlatform#8544)

Also fixes TestAccCloudBuildTrigger_basic_bitbucket test.

Co-authored-by: Mario Machado <[email protected]>
  • Loading branch information
2 people authored and nevzheng committed Aug 16, 2023
1 parent efc939e commit f1e7b99
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mmv1/products/cloudbuild/Trigger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ examples:
name: 'cloudbuild_trigger_manual_github_enterprise'
primary_resource_id: 'manual-ghe-trigger'
skip_test: true
- !ruby/object:Provider::Terraform::Examples
name: 'cloudbuild_trigger_manual_bitbucket_server'
primary_resource_id: 'manual-bitbucket-trigger'
- !ruby/object:Provider::Terraform::Examples
name: 'cloudbuild_trigger_repo'
primary_resource_id: 'repo-trigger'
Expand Down Expand Up @@ -252,6 +255,11 @@ properties:
description: |
The full resource name of the github enterprise config.
Format: projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}. projects/{project}/githubEnterpriseConfigs/{id}.
- !ruby/object:Api::Type::String
name: 'bitbucketServerConfig'
description: |
The full resource name of the bitbucket server config.
Format: projects/{project}/locations/{location}/bitbucketServerConfigs/{id}.
- !ruby/object:Api::Type::NestedObject
name: 'repositoryEventConfig'
description: |
Expand Down Expand Up @@ -378,6 +386,11 @@ properties:
description: |
The full resource name of the github enterprise config.
Format: projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}. projects/{project}/githubEnterpriseConfigs/{id}.
- !ruby/object:Api::Type::String
name: 'bitbucketServerConfig'
description: |
The full resource name of the bitbucket server config.
Format: projects/{project}/locations/{location}/bitbucketServerConfigs/{id}.
- !ruby/object:Api::Type::Array
name: 'ignoredFiles'
item_type: Api::Type::String
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
resource "google_cloudbuild_trigger" "<%= ctx[:primary_resource_id] %>" {
name = "terraform-manual-bbs-trigger"

source_to_build {
uri = "https://bbs.com/scm/stag/test-repo.git"
ref = "refs/heads/main"
repo_type = "BITBUCKET_SERVER"
bitbucket_server_config = "projects/myProject/locations/global/bitbucketServerConfigs/configID"
}

git_file_source {
path = "cloudbuild.yaml"
uri = "https://bbs.com/scm/stag/test-repo.git"
revision = "refs/heads/main"
repo_type = "BITBUCKET_SERVER"
bitbucket_server_config = "projects/myProject/locations/global/bitbucketServerConfigs/configID"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ resource "google_cloudbuild_trigger" "build_trigger" {
uri = "https://bitbucket.org/myorg/myrepo"
revision = "refs/heads/develop"
repo_type = "BITBUCKET_SERVER"
bitbucket_server_config = "projects/123456789/locations/us-central1/bitbucketServerConfigs/myBitbucketConfig"
}
}
`, name)
Expand Down

0 comments on commit f1e7b99

Please sign in to comment.