Buildkite output user input

97 Views Asked by At

I have a .buildkite.yml file with steps similar to the following:

steps:
  - name: "Release"
  command: ./auto/release
  
  - block: "Deploy with parameters"
    fields:
      - select: "Environment"
        key: "BUILD_STAGE"
        hint: "Which Environment do you want to deploy?"
        options:
          - label: "test"
            value: "test"
          - label: "sit"
            value: "sit"
  - wait
  - name: "Deploy app to ${BUILD_STAGE} env"
        command: ./auto/deploy

I want a prompt to show what the user selected. Obviously the last command name has a blank for BUILD_STAGE cause the user has not made a selection prior to the steps being generated.

Any ideas? Advice?

1

There are 1 best solutions below

0
On

You could create another step after "Deploy with parameters" to display the input. Something like this might work:

  - label: "Selected Environment"
    command: echo "You have selected the following environment:"; buildkite-agent meta-data get BUILD_STAGE