NewBuildCmd creates a new devspace build command
(f factory.Factory, globalFlags *flags.GlobalFlags, rawConfig *RawConfig)
| 9 | |
| 10 | // NewBuildCmd creates a new devspace build command |
| 11 | func NewBuildCmd(f factory.Factory, globalFlags *flags.GlobalFlags, rawConfig *RawConfig) *cobra.Command { |
| 12 | cmd := &RunPipelineCmd{ |
| 13 | GlobalFlags: globalFlags, |
| 14 | Pipeline: "build", |
| 15 | ForceBuild: true, |
| 16 | SkipPushLocalKubernetes: true, |
| 17 | } |
| 18 | |
| 19 | var pipeline *latest.Pipeline |
| 20 | if rawConfig != nil && rawConfig.Config != nil && rawConfig.Config.Pipelines != nil { |
| 21 | pipeline = rawConfig.Config.Pipelines["build"] |
| 22 | } |
| 23 | buildCmd := &cobra.Command{ |
| 24 | Use: "build", |
| 25 | Short: "Builds all defined images and pushes them", |
| 26 | Long: ` |
| 27 | ####################################################### |
| 28 | ################## devspace build ##################### |
| 29 | ####################################################### |
| 30 | Builds all defined images and pushes them |
| 31 | #######################################################`, |
| 32 | RunE: func(cobraCmd *cobra.Command, args []string) error { |
| 33 | return cmd.Run(cobraCmd, args, f, "buildCommand") |
| 34 | }, |
| 35 | } |
| 36 | cmd.AddPipelineFlags(f, buildCmd, pipeline) |
| 37 | return buildCmd |
| 38 | } |
no test coverage detected