File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change 99` go get -u github.com/codefresh-io/go-sdk `
1010
1111``` go
12-
1312import (
1413 " fmt"
1514 " os"
@@ -20,10 +19,24 @@ import (
2019
2120func main () {
2221 path := fmt.Sprintf (" %s /.cfconfig" , os.Getenv (" HOME" ))
23- options := utils.ReadAuthContext (path, " " )
24- cf := codefresh.New (options)
25- cf.Pipelines ().List ()
22+ options , err := utils.ReadAuthContext (path, " " )
23+ if err != nil {
24+ fmt.Println (" Failed to read codefresh config file" )
25+ panic (err)
26+ }
27+ clientOptions := codefresh.ClientOptions {Host: options.URL ,
28+ Auth: codefresh.AuthOptions {Token: options.Token }}
29+ cf := codefresh.New (&clientOptions)
30+ pipelines , err := cf.Pipelines ().List ()
31+ if err != nil {
32+ fmt.Println (" Failed to get Pipelines from Codefresh API" )
33+ panic (err)
34+ }
35+ for _ , p := range pipelines {
36+ fmt.Printf (" Pipeline: %+v \n\n " , p)
37+ }
2638}
39+
2740```
2841
29- This is not an official Codefresh project.
42+ This is not an official Codefresh project.
You can’t perform that action at this time.
0 commit comments