Created
July 30, 2016 07:14
-
-
Save toolmantim/e9d2cd2dacf2919b0090a0baa50b7a50 to your computer and use it in GitHub Desktop.
Demonstration of how to do environment variable substitution with buildkite-agent 2.x (in 3.x env var support is built-in)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -euo pipefail | |
| # Demonstration of how to do environment variable substitution with | |
| # buildkite-agent 2.x (in 3.x env var support is built-in) | |
| # | |
| # To use, save this file as .buildkite/pipeline.bash, chmod +x, and | |
| # then set your first pipeline step to run this and pipe it into | |
| # pipeline upload: | |
| # | |
| # .buildkite/pipeline.sh | buildkite-agent pipeline upload | |
| # | |
| cat << EOF | |
| steps: | |
| - trigger: "another-pipeline" | |
| build: | |
| message: "Deploying build $BUILDKITE_BUILD_NUMBER" | |
| commit: "$BUILDKITE_COMMIT" | |
| branch: "$BUILDKITE_BRANCH" | |
| env: | |
| SOME_ENV: "$SOME_ENV" | |
| EOF |
Author
@toolmantim .buildkite/pipeline.sh | buildkite-agent pipeline upload works great for me (adding the cat EOF stuff), but when I try ( echo "cat <<EOF" ; cat .buildkite/pipeline.yml ; echo EOF ) | sh | buildkite-agent pipeline upload on a regular pipeline file, it goes into an infinite loop and duplicates all the steps in the pipeline continuously
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternatively you could use the following pipeline upload step: