NewPurgeCmd creates a new purge command
(f factory.Factory, globalFlags *flags.GlobalFlags, rawConfig *RawConfig)
| 10 | |
| 11 | // NewPurgeCmd creates a new purge command |
| 12 | func NewPurgeCmd(f factory.Factory, globalFlags *flags.GlobalFlags, rawConfig *RawConfig) *cobra.Command { |
| 13 | cmd := &RunPipelineCmd{ |
| 14 | GlobalFlags: globalFlags, |
| 15 | Pipeline: "purge", |
| 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["purge"] |
| 22 | } |
| 23 | purgeCmd := &cobra.Command{ |
| 24 | Use: "purge", |
| 25 | Short: "Deletes deployed resources", |
| 26 | Long: ` |
| 27 | ####################################################### |
| 28 | ################### devspace purge #################### |
| 29 | ####################################################### |
| 30 | Deletes the deployed kubernetes resources: |
| 31 | |
| 32 | devspace purge |
| 33 | #######################################################`, |
| 34 | RunE: func(cobraCmd *cobra.Command, args []string) error { |
| 35 | return cmd.Run(cobraCmd, args, f, "purgeCommand") |
| 36 | }, |
| 37 | } |
| 38 | cmd.AddPipelineFlags(f, purgeCmd, pipeline) |
| 39 | return purgeCmd |
| 40 | } |
no test coverage detected