Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DeployCmd = &cobra.Command{ Use: "deploy [deploymentId] [flags] [site-directory]", Short: "Run a deployment", Long: ` Run a deployment by ID, or omit it to deploy the development environment. If no deploymentId is provided, the CLI will use the current project config to find the development environment deployment. If it doesn't exist yet, it will be created automatically. Usage: hyphen deploy [deploymentId] [flags] [site-directory] Examples: hyphen deploy # deploys the dev environment (auto-detected) hyphen deploy depl_abc123 # deploys a specific deployment by ID hyphen deploy --type static ./dist hyphen deploy depl_abc123 --no-build --apps api:latest --sites website:abld_123 --type selects the local build (docker by default). Static builds require the website directory as the final argument, unless --no-build is used. --apps and --sites select containers and static sites separately and may be combined. Use 'hyphen deploy --help' for more information about available flags. `, Args: func(cmd *cobra.Command, args []string) error { if _, _, err := deployArguments(args, buildType, noBuild, flags.DockerfileFlag); err != nil { return err } _, err := parseSelections(appsFlag, sitesFlag) return err }, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { return user.ErrorIfNotAuthenticated() }, RunE: func(cmd *cobra.Command, args []string) error { printer = cprint.NewCPrinter(flags.VerboseFlag) printer.SetFormat(outputFormatFlag) result, runErr := runDeployBody(cmd, args) if runErr != nil { if printer.IsJSON() { if result == nil { result = map[string]any{} } if _, ok := result["status"]; !ok { result["status"] = "failed" } result["reason"] = runErr.Error() if emitErr := printer.Emit(result); emitErr != nil { fmt.Fprintf(os.Stderr, "failed to emit JSON output: %v\n", emitErr) } cmd.SilenceErrors = true cmd.SilenceUsage = true } else { cmd.SilenceErrors = true cmd.SilenceUsage = true } return runErr } return printer.Emit(result) }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.