feat(ops/pipelines): Fetch parent target map for pipeline generation

Change-Id: I1c7d48fc0974549d67146a15f79ddb0b6ddfe805
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4947
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
Vincent Ambo 2022-01-16 18:20:15 +03:00 committed by tazjin
parent 0779f96687
commit 9596c642d5
2 changed files with 51 additions and 1 deletions

View file

@ -15,7 +15,17 @@ steps:
buildkite-agent annotate
fi
nix-build -A ops.pipelines.depot -o pipeline --show-trace
# Attempt to fetch a target map from a parent commit on canon,
# except on builds of canon itself.
[ "${BUILDKITE_BRANCH}" != "refs/heads/canon" ] && \
ops/pipelines/fetch-parent-targets.sh
PIPELINE_ARGS=""
if [[ -f ./parent-target-map.json ]]; then
PIPELINE_ARGS="--arg parentTargetMap ./parent-target-map.json"
fi
nix-build -A ops.pipelines.depot -o pipeline --show-trace $$PIPELINE_ARGS
# Steps need to be uploaded in reverse order because pipeline
# upload prepends instead of appending.