@@ -311,6 +311,38 @@ func TestAccCodefreshPipeline_Revision(t *testing.T) {
311
311
})
312
312
}
313
313
314
+ func TestAccCodefreshPipeline_IsPublic (t * testing.T ) {
315
+ name := pipelineNamePrefix + acctest .RandString (10 )
316
+ resourceName := "codefresh_pipeline.test"
317
+
318
+ resource .ParallelTest (t , resource.TestCase {
319
+ PreCheck : func () { testAccPreCheck (t ) },
320
+ Providers : testAccProviders ,
321
+ CheckDestroy : testAccCheckCodefreshPipelineDestroy ,
322
+ Steps : []resource.TestStep {
323
+ {
324
+ Config : testAccCodefreshPipelineBasicConfig (name , "codefresh-contrib/react-sample-app" , "./codefresh.yml" , "master" , "git" ),
325
+ Check : resource .ComposeTestCheckFunc (
326
+ testAccCheckCodefreshPipelineExists (resourceName ),
327
+ resource .TestCheckResourceAttr (resourceName , "is_public" , "false" ),
328
+ ),
329
+ },
330
+ {
331
+ ResourceName : resourceName ,
332
+ ImportState : true ,
333
+ ImportStateVerify : true ,
334
+ },
335
+ {
336
+ Config : testAccCodefreshPipelineIsPublic (name , "codefresh-contrib/react-sample-app" , "./codefresh.yml" , "development" , "git" , true ),
337
+ Check : resource .ComposeTestCheckFunc (
338
+ testAccCheckCodefreshPipelineExists (resourceName ),
339
+ resource .TestCheckResourceAttr (resourceName , "is_public" , "true" ),
340
+ ),
341
+ },
342
+ },
343
+ })
344
+ }
345
+
314
346
func TestAccCodefreshPipelineOnCreateBranchIgnoreTrigger (t * testing.T ) {
315
347
name := pipelineNamePrefix + acctest .RandString (10 )
316
348
resourceName := "codefresh_pipeline.test"
@@ -584,7 +616,7 @@ resource "codefresh_pipeline" "test" {
584
616
branch_regex_input = %q
585
617
pull_request_target_branch_regex = %q
586
618
comment_regex = %q
587
-
619
+
588
620
context = %q
589
621
contexts = [
590
622
%q
@@ -791,3 +823,30 @@ resource "codefresh_pipeline" "test" {
791
823
}
792
824
` , rName , repo , path , revision , context , branchName , ignoreTrigger )
793
825
}
826
+
827
+ func testAccCodefreshPipelineIsPublic (rName , repo , path , revision , context string , isPublic bool ) string {
828
+ return fmt .Sprintf (`
829
+ resource "codefresh_pipeline" "test" {
830
+
831
+ lifecycle {
832
+ ignore_changes = [
833
+ revision
834
+ ]
835
+ }
836
+
837
+ name = "%s"
838
+
839
+ spec {
840
+ spec_template {
841
+ repo = %q
842
+ path = %q
843
+ revision = %q
844
+ context = %q
845
+ }
846
+ }
847
+
848
+ is_public = %t
849
+
850
+ }
851
+ ` , rName , repo , path , revision , context , isPublic )
852
+ }
0 commit comments