2021-08-29 14:25:59 +02:00
|
|
|
# This file defines the static Buildkite pipeline which attempts to
|
|
|
|
# create the dynamic pipeline of all depot targets.
|
|
|
|
#
|
|
|
|
# If something fails during the creation of the pipeline, the fallback
|
|
|
|
# is executed instead which will simply report an error to Gerrit.
|
2020-11-17 23:27:38 +01:00
|
|
|
---
|
|
|
|
steps:
|
|
|
|
- label: ":llama:"
|
|
|
|
command: |
|
|
|
|
function fallback() {
|
|
|
|
echo 'Using fallback pipeline ...'
|
|
|
|
buildkite-agent pipeline upload ops/pipelines/fallback.yaml
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
2021-01-30 07:44:11 +01:00
|
|
|
nix-build -A ops.pipelines.depot -o depot.yaml --show-trace || fallback
|
2021-08-29 14:25:59 +02:00
|
|
|
buildkite-agent meta-data set 'failure' '0'
|
2020-11-17 23:27:38 +01:00
|
|
|
buildkite-agent pipeline upload depot.yaml || fallback
|
2021-11-05 13:59:57 +01:00
|
|
|
|
|
|
|
# Create a revision number for the current commit for builds on
|
|
|
|
# canon.
|
|
|
|
#
|
|
|
|
# This writes data back to Gerrit using the Buildkite agent
|
|
|
|
# credentials injected through a git credentials helper.
|
|
|
|
#
|
|
|
|
# Revision numbers are defined as the number of commits in the
|
|
|
|
# lineage of HEAD, following only the first parent of merges.
|
|
|
|
- label: ":git:"
|
|
|
|
if: "build.branch == 'refs/heads/canon'"
|
|
|
|
command: |
|
|
|
|
git -c 'credential.helper=/etc/secrets/buildkite-credential-helper' \
|
2021-11-05 15:31:21 +01:00
|
|
|
push origin "HEAD:refs/r/$(git rev-list --count --first-parent HEAD)"
|