mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-01 07:42:40 +00:00
Make cloudbuild trigger disabled field a bool (#3398)
Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
parent
13308c0ce7
commit
f82494c34f
|
@ -148,7 +148,7 @@ func resourceCloudBuildTrigger() *schema.Resource {
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"disabled": {
|
"disabled": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"filename": {
|
"filename": {
|
||||||
|
|
|
@ -16,7 +16,7 @@ func TestAccCloudBuildTrigger_basic(t *testing.T) {
|
||||||
CheckDestroy: testAccCheckCloudBuildTriggerDestroy,
|
CheckDestroy: testAccCheckCloudBuildTriggerDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
{
|
{
|
||||||
Config: testGoogleCloudBuildTrigger_basic(),
|
Config: testAccCloudBuildTrigger_basic(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ResourceName: "google_cloudbuild_trigger.build_trigger",
|
ResourceName: "google_cloudbuild_trigger.build_trigger",
|
||||||
|
@ -24,7 +24,35 @@ func TestAccCloudBuildTrigger_basic(t *testing.T) {
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Config: testGoogleCloudBuildTrigger_updated(),
|
Config: testAccCloudBuildTrigger_updated(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ResourceName: "google_cloudbuild_trigger.build_trigger",
|
||||||
|
ImportState: true,
|
||||||
|
ImportStateVerify: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestAccCloudBuildTrigger_disable(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
resource.Test(t, resource.TestCase{
|
||||||
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
|
Providers: testAccProviders,
|
||||||
|
CheckDestroy: testAccCheckCloudBuildTriggerDestroy,
|
||||||
|
Steps: []resource.TestStep{
|
||||||
|
{
|
||||||
|
Config: testAccCloudBuildTrigger_basic(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ResourceName: "google_cloudbuild_trigger.build_trigger",
|
||||||
|
ImportState: true,
|
||||||
|
ImportStateVerify: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Config: testAccCloudBuildTrigger_basicDisabled(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ResourceName: "google_cloudbuild_trigger.build_trigger",
|
ResourceName: "google_cloudbuild_trigger.build_trigger",
|
||||||
|
@ -55,7 +83,7 @@ func TestAccCloudBuildTrigger_fullStep(t *testing.T) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func testGoogleCloudBuildTrigger_basic() string {
|
func testAccCloudBuildTrigger_basic() string {
|
||||||
return fmt.Sprintf(`
|
return fmt.Sprintf(`
|
||||||
resource "google_cloudbuild_trigger" "build_trigger" {
|
resource "google_cloudbuild_trigger" "build_trigger" {
|
||||||
description = "acceptance test build trigger"
|
description = "acceptance test build trigger"
|
||||||
|
@ -84,6 +112,36 @@ resource "google_cloudbuild_trigger" "build_trigger" {
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func testAccCloudBuildTrigger_basicDisabled() string {
|
||||||
|
return fmt.Sprintf(`
|
||||||
|
resource "google_cloudbuild_trigger" "build_trigger" {
|
||||||
|
disabled = true
|
||||||
|
description = "acceptance test build trigger"
|
||||||
|
trigger_template {
|
||||||
|
branch_name = "master"
|
||||||
|
repo_name = "some-repo"
|
||||||
|
}
|
||||||
|
build {
|
||||||
|
images = ["gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA"]
|
||||||
|
tags = ["team-a", "service-b"]
|
||||||
|
step {
|
||||||
|
name = "gcr.io/cloud-builders/gsutil"
|
||||||
|
args = ["cp", "gs://mybucket/remotefile.zip", "localfile.zip"]
|
||||||
|
}
|
||||||
|
step {
|
||||||
|
name = "gcr.io/cloud-builders/go"
|
||||||
|
args = ["build", "my_package"]
|
||||||
|
env = ["env1=two"]
|
||||||
|
}
|
||||||
|
step {
|
||||||
|
name = "gcr.io/cloud-builders/docker"
|
||||||
|
args = ["build", "-t", "gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA", "-f", "Dockerfile", "."]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|
||||||
func testAccCloudBuildTrigger_fullStep() string {
|
func testAccCloudBuildTrigger_fullStep() string {
|
||||||
return fmt.Sprintf(`
|
return fmt.Sprintf(`
|
||||||
resource "google_cloudbuild_trigger" "build_trigger" {
|
resource "google_cloudbuild_trigger" "build_trigger" {
|
||||||
|
@ -110,7 +168,7 @@ resource "google_cloudbuild_trigger" "build_trigger" {
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testGoogleCloudBuildTrigger_updated() string {
|
func testAccCloudBuildTrigger_updated() string {
|
||||||
return fmt.Sprintf(`
|
return fmt.Sprintf(`
|
||||||
resource "google_cloudbuild_trigger" "build_trigger" {
|
resource "google_cloudbuild_trigger" "build_trigger" {
|
||||||
description = "acceptance test build trigger updated"
|
description = "acceptance test build trigger updated"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user