diff options
Diffstat (limited to 'ops/pipelines/static-pipeline.yaml')
-rw-r--r-- | ops/pipelines/static-pipeline.yaml | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ops/pipelines/static-pipeline.yaml b/ops/pipelines/static-pipeline.yaml new file mode 100644 index 000000000000..c864aea65714 --- /dev/null +++ b/ops/pipelines/static-pipeline.yaml @@ -0,0 +1,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)" |