Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update repoType to accept bitbucket_server #6816

Merged
merged 1 commit into from
Nov 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions mmv1/products/cloudbuild/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ objects:
required: true
description: |
The type of the repo, since it may not be explicit from the repo field (e.g from a URL).
Values can be UNKNOWN, CLOUD_SOURCE_REPOSITORIES, GITHUB, BITBUCKET
Values can be UNKNOWN, CLOUD_SOURCE_REPOSITORIES, GITHUB, BITBUCKET_SERVER
values:
- :UNKNOWN
- :CLOUD_SOURCE_REPOSITORIES
- :GITHUB
- :BITBUCKET
- :BITBUCKET_SERVER
- !ruby/object:Api::Type::String
name: 'revision'
description: |
Expand Down Expand Up @@ -175,12 +175,12 @@ objects:
required: true
description: |
The type of the repo, since it may not be explicit from the repo field (e.g from a URL).
Values can be UNKNOWN, CLOUD_SOURCE_REPOSITORIES, GITHUB, BITBUCKET
Values can be UNKNOWN, CLOUD_SOURCE_REPOSITORIES, GITHUB, BITBUCKET_SERVER
values:
- :UNKNOWN
- :CLOUD_SOURCE_REPOSITORIES
- :GITHUB
- :BITBUCKET
- :BITBUCKET_SERVER
- !ruby/object:Api::Type::Array
name: 'ignoredFiles'
item_type: Api::Type::String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,27 @@ func TestAccCloudBuildTrigger_fullStep(t *testing.T) {
})
}

func TestAccCloudBuildTrigger_basic_bitbucket(t *testing.T) {
t.Parallel()
name := fmt.Sprintf("tf-test-%d", randInt(t))

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckCloudBuildTriggerDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccCloudBuildTrigger_basic_bitbucket(name),
},
{
ResourceName: "google_cloudbuild_trigger.build_trigger",
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccCloudBuildTrigger_basic(name string) string {
return fmt.Sprintf(`
resource "google_cloudbuild_trigger" "build_trigger" {
Expand Down Expand Up @@ -266,6 +287,25 @@ resource "google_cloudbuild_trigger" "build_trigger" {
`, name)
}

func testAccCloudBuildTrigger_basic_bitbucket(name string) string {
return fmt.Sprintf(`
resource "google_cloudbuild_trigger" "build_trigger" {
name = "%s"
description = "acceptance test build trigger on bitbucket"
trigger_template {
branch_name = "main"
repo_name = "some-repo"
}
git_file_source {
path = "cloudbuild.yaml"
uri = "https://bitbucket.org/myorg/myrepo"
revision = "refs/heads/develop"
repo_type = "BITBUCKET_SERVER"
}
}
`, name)
}

func testAccCloudBuildTrigger_basicDisabled(name string) string {
return fmt.Sprintf(`
resource "google_cloudbuild_trigger" "build_trigger" {
Expand Down