|
| 1 | +package cmd |
| 2 | + |
| 3 | +import ( |
| 4 | + "github.com/spf13/cobra" |
| 5 | + helmtrans "helmtrans/src" |
| 6 | +) |
| 7 | + |
| 8 | +var filePath, outPutPath string |
| 9 | + |
| 10 | +//init |
| 11 | +func init() { |
| 12 | + //migration data |
| 13 | + helmtransYamltoHelmCmd.Flags().StringVarP(&filePath, "path", "p", "", "file path") |
| 14 | + helmtransYamltoHelmCmd.Flags().StringVarP(&outPutPath, "outpath", "o", "output", "output file path") |
| 15 | + rootCmd.AddCommand(helmtransYamltoHelmCmd) |
| 16 | + |
| 17 | + helmtransHelmtoYamlCmd.Flags().StringVarP(&filePath, "path", "p", "", "file path") |
| 18 | + rootCmd.AddCommand(helmtransHelmtoYamlCmd) |
| 19 | + |
| 20 | + helmtransCheckCmd.Flags().StringVarP(&filePath, "path", "p", "", "file path") |
| 21 | + rootCmd.AddCommand(helmtransCheckCmd) |
| 22 | +} |
| 23 | + |
| 24 | +//register deploy command |
| 25 | +var helmtransYamltoHelmCmd = &cobra.Command{ |
| 26 | + Use: "yamltohelm", |
| 27 | + Short: "Transform yaml to helm", |
| 28 | + Long: `Transform yaml to helm`, |
| 29 | + Run: func(cmd *cobra.Command, args []string) { |
| 30 | + //TO-DO |
| 31 | + helmtrans.YamltoHelm(filePath, outPutPath) |
| 32 | + }, |
| 33 | +} |
| 34 | + |
| 35 | +//register reset command |
| 36 | +var helmtransHelmtoYamlCmd = &cobra.Command{ |
| 37 | + Use: "helmtoyaml", |
| 38 | + Short: "Transform helm to yaml", |
| 39 | + Long: `Transform helm to yaml`, |
| 40 | + Run: func(cmd *cobra.Command, args []string) { |
| 41 | + //TO-DO |
| 42 | + }, |
| 43 | +} |
| 44 | + |
| 45 | +//register analyse command |
| 46 | +var helmtransCheckCmd = &cobra.Command{ |
| 47 | + Use: "check", |
| 48 | + Short: "Check helm", |
| 49 | + Long: `Check helm`, |
| 50 | + Run: func(cmd *cobra.Command, args []string) { |
| 51 | + //TO-DO |
| 52 | + |
| 53 | + }, |
| 54 | +} |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
0 commit comments