Command Steps

A command step runs one or more shell commands on an agent. Each command step can run either a shell command like npm install, or an executable file or script like build.sh.

Screenshot of a basic command step

A basic command step can be defined in your pipeline settings, or in your pipeline.yml file.

steps:
  - command: "tests.sh"

Command Step Attributes

Required attributes:

command The shell command/s to run during this step. This can be a single line of commands, or a YAML list.
Example: "build.sh"
Example:
- "npm install"
- "tests.sh"
steps:
  - command: "npm install && tests.sh"
steps:
  - command:
    - "npm install && npm test" 
    - "moretests.sh"
    - "build.sh"

Optional attributes:

label The label that will be displayed in the pipeline visualisation in Buildkite. Supports emoji.
Example: ":hammer: Tests"
branches The branch pattern defining which branches will include this step in their builds.
Example: "master stable/*"
env A map of environment variables for this step.
Example: RAILS_ENV: "test"
agents A map of meta-data keys to values to target specific agents for this step.
Example: npm: "true"
artifact_paths The glob path or paths where artifacts from this step will be uploaded. This can be a single line of paths separated by semicolons, or a YAML list.
Example: "logs/**/*;coverage/**/*"
Example:
- "logs/**/*"
- "coverage/**/*"
parallelism The number of parallel jobs that will be created based on this step.
Example: 3
concurrency The maximum number of jobs created from this step that are allowed to run at the same time. If you use this attribute, you must also define a label for it with the concurrency_group attribute.
Example: 3
concurrency_group A unique name for the concurrency group that you are creating with the concurrency attribute.
Example: "my-app/deploy"
timeout_in_minutes The number of minutes a job created from this step is allowed to run. If the job does not finish within this limit, it will be automatically cancelled and the build will fail.
Example: 60
skip Whether to skip this step or not.
Note: Skipped steps will be hidden in the pipeline view by default, but can be made visible by toggling the 'Skipped jobs' icon.
Example: true
Example: false
Example: "My reason"
steps:
  - label: ":hammer: Tests"
    command: 
      - "npm install"
      - "tests.sh"
    branches: "master"
    env:
      RAILS_ENV: "test"
      RACK_ENV: "test"
    agents:
      npm: "true"
      queue: "tests"
    artifact_paths:
      - "logs/**/*"
      - "coverage/**/*"
    parallelism: 1
    timeout_in_minutes: 60
  - wait
  - label: ":shipit: Deploy"
    command: "deploy.sh"
    branches: "master"
    concurrency: 1
    concurrency_group: "my-app/deploy"
  - label: "Skipped job"
    command: "my_command.sh"
    skip: "Didn't feel like it"