// buildJobDeployCmd builds the `job deploy` subcommand.
buildJobDeployCmd builds the `job deploy` subcommand.
// buildJobDeployCmd builds the ` job deploy ` subcommand .
func buildJobDeployCmd() *cobra.Command {
	vars := deployJobVars{}
	cmd := &cobra.Command{
		Use:   "deploy",
		Short: "Deploys a job to an environment.",
		Long:  `Deploys a job to an environment.`,
		Example: `
  Deploys a job named "report-gen" to a "test" environment.
  /code $ copilot job deploy --name report-gen --env test
  Deploys a job with additional resource tags.
  /code $ copilot job deploy --resource-tags source/revision=bb133e7,deployment/initiator=manual`,
		RunE: runCmdE(func(cmd *cobra.Command, args []string) error {
			opts, err := newJobDeployOpts(vars)
			if err != nil {
				return err
			}
			if err := opts.Validate(); err != nil {
				return err
			}
			if err := opts.Ask(); err != nil {
				return err
			}
			if err := opts.Execute(); err != nil {
				return err
			}
			return nil
		}),
	}
	cmd.Flags().StringVarP(&vars.appName, appFlag, appFlagShort, tryReadingAppName(), appFlagDescription)
	cmd.Flags().StringVarP(&vars.name, nameFlag, nameFlagShort, "", jobFlagDescription)
	cmd.Flags().StringVarP(&vars.envName, envFlag, envFlagShort, "", envFlagDescription)
	cmd.Flags().StringVar(&vars.imageTag, imageTagFlag, "", imageTagFlagDescription)
	cmd.Flags().StringToStringVar(&vars.resourceTags, resourceTagsFlag, nil, resourceTagsFlagDescription)
	return cmd
}
func buildJobDeployCmd ( ) * cobra . Command { vars := deployJobVars { } cmd := & cobra . Command { Use : " " , Short : " " , Long : `Deploys a job to an environment.` , Example : `
  Deploys a job named "report-gen" to a "test" environment.
  /code $ copilot job deploy --name report-gen --env test
  Deploys a job with additional resource tags.
  /code $ copilot job deploy --resource-tags source/revision=bb133e7,deployment/initiator=manual` , RunE : runCmdE ( func ( cmd * cobra . Command , args [ ] string ) error { opts , err := newJobDeployOpts ( vars ) if err != nil { return err } if err := opts . Validate ( ) ; err != nil { return err } if err := opts . Ask ( ) ; err != nil { return err } if err := opts . Execute ( ) ; err != nil { return err } return nil } ) , } cmd . Flags ( ) . StringVarP ( & vars . appName , appFlag , appFlagShort , tryReadingAppName ( ) , appFlagDescription ) cmd . Flags ( ) . StringVarP ( & vars . name , nameFlag , nameFlagShort , " " , jobFlagDescription ) cmd . Flags ( ) . StringVarP ( & vars . envName , envFlag , envFlagShort , " " , envFlagDescription ) cmd . Flags ( ) . StringVar ( & vars . imageTag , imageTagFlag , " " , imageTagFlagDescription ) cmd . Flags ( ) . StringToStringVar ( & vars . resourceTags , resourceTagsFlag , nil , resourceTagsFlagDescription ) return cmd }
buildJobDeployCmd builds the `job deploy` subcommand.
buildJobDeployCmd builds the ` job deploy ` subcommand .