runE generates the pipeline and writes it into a file or stdout.
(c *cobra.Command, args []string)
| 110 | |
| 111 | // runE generates the pipeline and writes it into a file or stdout. |
| 112 | func (r *ExportRunner) runE(c *cobra.Command, args []string) error { |
| 113 | pipeline, e := r.Pipeline.Init(r.PipelineConfig).Generate() |
| 114 | |
| 115 | if e != nil { |
| 116 | return e |
| 117 | } |
| 118 | |
| 119 | if r.OutputFilePath != "" { |
| 120 | fo, err := os.Create(r.OutputFilePath) |
| 121 | |
| 122 | if err != nil { |
| 123 | return err |
| 124 | } |
| 125 | |
| 126 | c.SetOut(fo) |
| 127 | } |
| 128 | |
| 129 | _, err := c.OutOrStdout().Write(pipeline) |
| 130 | |
| 131 | return err |
| 132 | } |
| 133 | |
| 134 | func supportedOrchestrators() map[string]orchestrators.Pipeline { |
| 135 | return map[string]orchestrators.Pipeline{ |