buildkite / cli

A command line interface for Buildkite.
MIT License
168 stars 44 forks source link

`bk build new` can't set environment variables #376

Closed amartani closed 1 month ago

amartani commented 1 month ago

It seems that the new 3.x version of the CLI has renamed bk build create to bk build new, and, in the process, lost the --env flag to set environment variables in the created build. Could you re-add the --env flag (or some other way to specify environment variables when creating builds via the CLI)? Thanks!

mcncl commented 1 month ago

@amartani interesting, that seems like a typo on my part. I'll fix it today and un-release the latest.

mcncl commented 1 month ago

Oh, actually, I thought you meant that in the latest release of 3.x we'd changed the command, but it's always been bk build new, you can pass env in with -e flags for each env you wish to set, if you are using 3.1.0.


bk build new -e "FOO=BAR" -e "BAR=BAZ"
amartani commented 1 month ago

Doesn't seem to work for me:

$ bk --version
bk version 3.1.0

$ bk build new -e "FOO=BAR" -e "BAR=BAZ"
Error: unknown shorthand flag: 'e' in -e
Usage:
  bk build new [flags]

Flags:
  -m, --message string    Description of the build. If left blank, the commit message will be used once the build starts.
  -c, --commit string     The commit to build. (default "HEAD")
  -b, --branch string     The branch to build. Defaults to the default branch of the pipeline.
  -w, --web               Open the build in a web browser after it has been created.
  -p, --pipeline string   The pipeline to build. This can be a {pipeline slug} or in the format {org slug}/{pipeline slug}.
                          If omitted, it will be resolved using the current directory.
  -y, --yes               Skip the confirmation prompt. Useful if being used in automation/CI.
  -h, --help              help for new
amartani commented 1 month ago

No idea what happened, but I re-installed bk 3.1.0 and it does seem to have the new parameter. Looks like I somehow got a binary that was stamped as 3.1.0 but didn't contain the change.