(w *world.World)
| 20 | ) |
| 21 | |
| 22 | func 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 | |
| 38 | func rolloutPreRun(_ *world.World) func(*cobra.Command, []string) error { |
| 39 | return func(cmd *cobra.Command, args []string) error { |
no test coverage detected