File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ var cfgFile string
3030var rootCmd = & cobra.Command {
3131 Use : "cfctl" ,
3232 Short : "A command line application for Codefresh" ,
33- Long : `` ,
3433
3534 PersistentPreRunE : func (cmd * cobra.Command , args []string ) error {
3635 configPath := cmd .Flag ("cfconfig" ).Value .String ()
Original file line number Diff line number Diff line change 11package codefresh
22
33import (
4+ "fmt"
5+ "net/url"
46 "time"
57)
68
79type (
810 // IPipelineAPI declers Codefresh pipeline API
911 IPipelineAPI interface {
1012 GetPipelines () []* Pipeline
13+ RunPipeline (string ) string
1114 }
1215
1316 PipelineMetadata struct {
@@ -67,3 +70,11 @@ func (c *codefresh) GetPipelines() []*Pipeline {
6770 resp .JSON (r )
6871 return r .Docs
6972}
73+
74+ func (c * codefresh ) RunPipeline (name string ) string {
75+ resp := c .requestAPI (& requestOptions {
76+ path : fmt .Sprintf ("/api/pipelines/run/%s" , url .PathEscape (name )),
77+ method : "POST" ,
78+ })
79+ return resp .String ()
80+ }
You can’t perform that action at this time.
0 commit comments