diff --git a/cmd/ci.go b/cmd/ci.go index ed02f512070295a90e4fe82e323dae2bb5631df6..718f67e95459dd876ccbfcfeec130665b7fbd47e 100644 --- a/cmd/ci.go +++ b/cmd/ci.go @@ -48,17 +48,7 @@ var ciCmd = &cobra.Command{ func init() { rootCmd.AddCommand(ciCmd) - // Here you will define your flags and configuration settings. - - // Cobra supports Persistent Flags which will work for this command - // and all subcommands, e.g.: - // configCmd.PersistentFlags().String("foo", "", "A help for foo") ciCmd.PersistentFlags().StringVarP(&environmentSuffix, "environment", "e", "", "environment suffix to append to helm release name") - ciCmd.PersistentFlags().StringVarP(&imageTag, "image-tag", "i", "", "image tag for docker") - - // Cobra supports local flags which will only run when this command - // is called directly, e.g.: - // configCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") } func getCiConfiguration() config.Config { diff --git a/cmd/ci_build.go b/cmd/ci_build.go index d0a630beac7035b7761e193b345687dbf15be0d0..91be6e9c4ab0b6fa63de2b1f17175a4b2a41018d 100644 --- a/cmd/ci_build.go +++ b/cmd/ci_build.go @@ -82,6 +82,7 @@ func init() { panic("invalid arg") } + ciBuildCmd.PersistentFlags().StringVarP(&imageTag, "image-tag", "i", "", "image tag for docker") err = ciBuildCmd.MarkPersistentFlagRequired("image-tag") if err != nil { panic("invalid arg") diff --git a/cmd/ci_deploy.go b/cmd/ci_deploy.go index 863ca289fd3fa2293db5cdc348827ebc47e718de..d03cf8e018eb1d13dd9190119e72f28a53636a11 100644 --- a/cmd/ci_deploy.go +++ b/cmd/ci_deploy.go @@ -40,6 +40,7 @@ var ciDeployCmd = &cobra.Command{ } func init() { + ciDeployCmd.PersistentFlags().StringVarP(&imageTag, "image-tag", "i", "", "image tag for docker") err := ciDeployCmd.MarkPersistentFlagRequired("image-tag") if err != nil { panic("invalid arg")