Skip to content

Instantly share code, notes, and snippets.

@lox
Last active May 22, 2018 02:50
Show Gist options
  • Save lox/35760841401d79021926b6b87a25f443 to your computer and use it in GitHub Desktop.
Save lox/35760841401d79021926b6b87a25f443 to your computer and use it in GitHub Desktop.
Test passing artifacts between triggered builds
#!/bin/bash
buildkite-agent artifact download test.txt .
cat test.txt
steps:
- trigger: "trigger-artifact-test-2"
label: ":rocket: Trigger trigger-test-2"
build:
meta_data:
triggering-job-id: "${BUILDKITE_JOB_ID}"
- wait
- label: "Get artifacts from triggered build"
command: bash ./get-artifacts-from-triggered-build.sh
steps:
- label: ":llama:"
command: bash ./upload-artifacts.sh
hello world
#!/bin/bash
set -euxo pipefail
triggered_job_id="$(buildkite-agent meta-data get triggering-job-id)"
echo "triggered by $triggered_job_id"
buildkite-agent artifact upload --job "$triggered_job_id" test.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment