func BuildDeployAppCmd()

in internal/pkg/cli/app_deploy.go [145:172]


func BuildDeployAppCmd() *cobra.Command {
	opts := NewDeployAppOpts()
	cmd := &cobra.Command{
		Use:   "deploy",
		Short: "Deploy the application",
		Long:  `Provisions (or updates) the Amazon ECS infrastructure for the application defined using the Open Application Model spec. All component schematics and the application configuration file for the application must be provided every time the 'app deploy' command runs (this CLI does not save any state).`,
		Example: `
  Deploy the application's OAM component schematic files and application configuration file:
	$ oam-ecs app deploy -f component1.yml,component2.yml,config.yml`,
		PreRunE: runCmdE(func(cmd *cobra.Command, args []string) error {
			session, err := session.Default()
			if err != nil {
				return err
			}
			opts.ComponentDeployer = cloudformation.New(session)
			return nil
		}),
		RunE: runCmdE(func(cmd *cobra.Command, args []string) error {
			return opts.Execute()
		}),
	}

	cmd.Flags().StringSliceVarP(&opts.OamFiles, oamFileFlag, oamFileFlagShort, []string{}, oamFileFlagDescription)
	cmd.MarkFlagRequired(oamFileFlag)
	cmd.Flags().BoolVarP(&opts.DryRun, dryRunFlag, "", false, dryRunFlagDescription)

	return cmd
}