From e70428e75b624f9aa467fbd563e016abac587a82 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 30 Mar 2022 11:52:05 +0200 Subject: refactor(ops/pipelines): Configurable GraphQL token location For external users of the pipeline construction, the token might be in a different path than `/run/agenix/buildkite-graphql-token`. It is made configurable through the BUILDKITE_TOKEN_PATH environment variable. This should be configured on the pipeline level to apply to all steps. Change-Id: I23c52e2d705e4134b8b013f8603f92e5533a6e44 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5424 Autosubmit: tazjin Tested-by: BuildkiteCI Reviewed-by: asmundo --- nix/buildkite/fetch-parent-targets.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nix') diff --git a/nix/buildkite/fetch-parent-targets.sh b/nix/buildkite/fetch-parent-targets.sh index ca65646abd..8afac1e5ec 100755 --- a/nix/buildkite/fetch-parent-targets.sh +++ b/nix/buildkite/fetch-parent-targets.sh @@ -14,6 +14,7 @@ set -ueo pipefail # build all targets. : ${DRVMAP_PATH:=pipeline/drvmap.json} +: ${BUILDKITE_TOKEN_PATH:=~/buildkite-token} git fetch -v origin "${BUILDKITE_PIPELINE_DEFAULT_BRANCH}" @@ -25,7 +26,7 @@ function most_relevant_builds { set -u curl 'https://graphql.buildkite.com/v1' \ --silent \ - -H "Authorization: Bearer $(cat /run/agenix/buildkite-graphql-token)" \ + -H "Authorization: Bearer $(cat ${BUILDKITE_TOKEN_PATH})" \ -d "{\"query\": \"query { pipeline(slug: \\\"$BUILDKITE_ORGANIZATION_SLUG/$BUILDKITE_PIPELINE_SLUG\\\") { builds(commit: [\\\"$FIRST\\\",\\\"$SECOND\\\",\\\"$THIRD\\\"]) { edges { node { uuid }}}}}\"}" | \ jq -r '.data.pipeline.builds.edges[] | .node.uuid' } -- cgit 1.4.1