From a4aabaff687cf0e4a6d0fe1851823a51b407f316 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 22 Jan 2022 14:06:54 +0300 Subject: refactor(ops/pipelines): Move :git: step up in the pipeline This step is independent of the build result and can be scheduled at the beginning while pipeline eval is still in progress. Change-Id: I2ee268e4c333efa654dcb12c0b1562b43231d241 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5044 Tested-by: BuildkiteCI Autosubmit: tazjin Reviewed-by: ezemtsov --- ops/pipelines/static-pipeline.yaml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'ops/pipelines/static-pipeline.yaml') diff --git a/ops/pipelines/static-pipeline.yaml b/ops/pipelines/static-pipeline.yaml index b0170e9a017a..d1b42854cfce 100644 --- a/ops/pipelines/static-pipeline.yaml +++ b/ops/pipelines/static-pipeline.yaml @@ -15,6 +15,21 @@ steps: build: message: "Verification triggered by ${BUILDKITE_COMMIT}" + # 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=gerrit-creds' \ + push origin "HEAD:refs/r/$(git rev-list --count --first-parent HEAD)" + + # Generate & upload dynamic build steps - label: ":llama:" key: "pipeline-gen" command: | @@ -97,17 +112,3 @@ steps: depends_on: - step: ":duck:" allow_failure: false - - # 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=gerrit-creds' \ - push origin "HEAD:refs/r/$(git rev-list --count --first-parent HEAD)" -- cgit 1.4.1