blob: c864aea65714181e0e86859ff8b6e6896433e000 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# 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.
---
steps:
- label: ":llama:"
command: |
function fallback() {
echo 'Using fallback pipeline ...'
buildkite-agent pipeline upload ops/pipelines/fallback.yaml
exit
}
nix-build -A ops.pipelines.depot -o depot.yaml --show-trace || fallback
buildkite-agent pipeline upload depot.yaml || fallback
# 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' \
push origin "HEAD:refs/r/$(git rev-list --count --first-parent HEAD)"
|