MCPcopy Index your code
hub / github.com/bytebase/bytebase / NewRolloutCommand

Function NewRolloutCommand

action/command/rollout.go:22–36  ·  view source on GitHub ↗
(w *world.World)

Source from the content-addressed store, hash-verified

20)
21
22func NewRolloutCommand(w *world.World) *cobra.Command {
23 // bytebase-action rollout flags
24 cmdRollout := &cobra.Command{
25 Use: "rollout",
26 Short: "Rollout the migrate files",
27 Args: cobra.NoArgs,
28 PersistentPreRunE: rolloutPreRun(w),
29 RunE: runRollout(w),
30 }
31 cmdRollout.Flags().StringVar(&w.TargetStage, "target-stage", "", "Rollout up to the target stage. Format: environments/{environment}.")
32 cmdRollout.Flags().StringVar(&w.Plan, "plan", "", "The plan to rollout. Format: projects/{project}/plans/{plan}. Shadows file-pattern and targets.")
33 cmdRollout.Flags().StringVar(&w.ReleaseIDTemplate, "release-id-template", "release_{date}-RC{iteration}", "Template for release ID. Available variables: {date}, {time}, {timestamp}, {iteration}")
34 cmdRollout.Flags().StringVar(&w.ReleaseIDTimezone, "release-id-timezone", "UTC", "Timezone for {date} and {time} variables (e.g., 'UTC', 'America/Los_Angeles')")
35 return cmdRollout
36}
37
38func rolloutPreRun(_ *world.World) func(*cobra.Command, []string) error {
39 return func(cmd *cobra.Command, args []string) error {

Callers 1

NewRootCommandFunction · 0.85

Calls 2

rolloutPreRunFunction · 0.85
runRolloutFunction · 0.85

Tested by

no test coverage detected