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 --- ops/pipelines/static-pipeline.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ops/pipelines') diff --git a/ops/pipelines/static-pipeline.yaml b/ops/pipelines/static-pipeline.yaml index 23a1fba4f21a..2936f56d2c61 100644 --- a/ops/pipelines/static-pipeline.yaml +++ b/ops/pipelines/static-pipeline.yaml @@ -4,6 +4,8 @@ # If something fails during the creation of the pipeline, the fallback # is executed instead which will simply report an error to Gerrit. --- +env: + BUILDKITE_TOKEN_PATH: /run/agenix/buildkite-graphql-token steps: # Run pipeline for tvl-kit when new commits arrive on canon. Since # it is not part of the depot build tree, this is a useful @@ -85,7 +87,7 @@ steps: readonly FAILED_JOBS=$(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 BuildStatusQuery { build(uuid: \\\"$BUILDKITE_BUILD_ID\\\") { jobs(passed: false) { count } } }\"}" | \ jq -r '.data.build.jobs.count') -- cgit 1.4.1