How to pass artifact to a trigger

Hi all,

I have a script like the following:

Script for build 1


  • wait
  • label: “create artifact”
    command: echo “something” > textfile
    artifact_paths: [“textfile”]
  • trigger: another_build

Script for another_build


  • wait
  • label: “display artifact”
    command: cat textfile

My question is how to pass the artifact “textfile” from one job to another job?

Thank you

Hey @terence thanks for raising this, you can do this by uploading and downloading the artifacts.

Pipeline A

  • commands: |
    echo ‘bar’ > foo
    buildkite-agent artifact upload foo
  • wait
  • trigger: pipeline-b

Pipeline B

  • commands: |
    buildkite-agent artifact download --build “$$BUILDKITE_TRIGGERED_FROM_BUILD_ID” foo .
    cat foo