@@ -87,7 +87,8 @@ type ExecJobConfig struct {
8787 Debug bool `cli:"debug"`
8888 Shell string `cli:"shell"`
8989 Experiments []string `cli:"experiment" normalize:"list"`
90- Phases []string `cli:"phases" normalize:"list"`
90+ Phases []string `cli:"phases" normalize:"list" deprecated-and-renamed-to:"exec-phases"`
91+ ExecPhases []string `cli:"exec-phases" normalize:"list"`
9192 Profile string `cli:"profile"`
9293 CancelSignal string `cli:"cancel-signal"`
9394 RedactedVars []string `cli:"redacted-vars" normalize:"list"`
@@ -322,6 +323,11 @@ var execJobFlags = []cli.Flag{
322323 },
323324 cli.StringSliceFlag {
324325 Name : "phases" ,
326+ Usage : "[DEPRECATED] The specific phases to execute. The order they're defined is irrelevant." ,
327+ EnvVar : "BUILDKITE_BOOTSTRAP_PHASES" ,
328+ },
329+ cli.StringSliceFlag {
330+ Name : "exec-phases" ,
325331 Usage : "The specific phases to execute. The order they're defined is irrelevant." ,
326332 EnvVar : "BUILDKITE_BOOTSTRAP_PHASES" ,
327333 },
@@ -509,16 +515,12 @@ func execJobAction(c *cli.Context) {
509515 os .Exit (exitCode )
510516}
511517
512- var (
513- BootstrapCommand = genBootstrap ()
514- ExecJobCommand = genExecJob ()
515- )
516-
517518func genBootstrap () cli.Command {
518519 var help strings.Builder
519520 help .WriteString ("⚠️ ⚠️ ⚠️\n " )
520521 help .WriteString ("DEPRECATED: Use `buildkite-agent exec-job` instead\n " )
521522 help .WriteString ("⚠️ ⚠️ ⚠️\n \n " )
523+
522524 err := execJobHelpTpl .Execute (& help , "bootstrap" )
523525 if err != nil {
524526 // This can only hapen if we've mangled the template or its parsing
@@ -532,7 +534,13 @@ func genBootstrap() cli.Command {
532534 Usage : "[DEPRECATED] Run a Buildkite job locally" ,
533535 Description : help .String (),
534536 Flags : execJobFlags ,
535- Action : execJobAction ,
537+ Action : func (c * cli.Context ) {
538+ fmt .Println ("⚠️ WARNING ⚠️" )
539+ fmt .Println ("This command (`buildkite-agent bootstrap`) is deprecated and will be removed in a future release" )
540+ fmt .Println ("Please use `buildkite-agent exec-job` instead" )
541+ fmt .Println ("" )
542+ execJobAction (c )
543+ },
536544 }
537545}
538546
@@ -551,12 +559,11 @@ func genExecJob() cli.Command {
551559 Usage : "Run a Buildkite job locally" ,
552560 Description : help .String (),
553561 Flags : execJobFlags ,
554- Action : func (c * cli.Context ) {
555- fmt .Println ("⚠️ WARNING ⚠️" )
556- fmt .Println ("This command (`buildkite-agent bootstrap`) is deprecated and will be removed in a future release" )
557- fmt .Println ("Please use `buildkite-agent exec-job` instead." )
558- fmt .Println ("" )
559- execJobAction (c )
560- },
562+ Action : execJobAction ,
561563 }
562564}
565+
566+ var (
567+ BootstrapCommand = genBootstrap ()
568+ ExecJobCommand = genExecJob ()
569+ )
0 commit comments