]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-dev-pipeline: Consume SHA1 parameter 2412/head
authorZack Cerza <zack@cerza.org>
Fri, 25 Jul 2025 16:40:53 +0000 (10:40 -0600)
committerZack Cerza <zack@cerza.org>
Fri, 25 Jul 2025 21:42:55 +0000 (15:42 -0600)
If SHA1 is passed, ensure it is reflected in the consumed artifact.

Signed-off-by: Zack Cerza <zack@cerza.org>
ceph-dev-pipeline/build/Jenkinsfile
ceph-dev-pipeline/config/definitions/ceph-dev-pipeline.yml

index 7bbd8cb4b798448c535d2a96669b909c34fc9a7b..1266444dc7ae54316ccf769e4172bc4ac8b79d5b 100644 (file)
@@ -146,6 +146,7 @@ pipeline {
               parameters: [
                 string(name: "BRANCH", value: env.BRANCH),
                 // Below are just for ceph-source-dist
+                string(name: "SHA1", value: env.SHA1),
                 string(name: "CEPH_REPO", value: env.CEPH_REPO),
                 string(name: "CEPH_BUILD_BRANCH", value: env.CEPH_BUILD_BRANCH),
               ]
@@ -263,9 +264,13 @@ pipeline {
                 )
               }
               script {
+                def sha1_trimmed = env.SHA1.trim().toLowerCase()
                 def sha1_props = readProperties file: "${WORKSPACE}/dist/sha1"
-                env.SHA1 = sha1_props.SHA1
-                println "SHA1=${env.SHA1}"
+                sha1_from_artifact = sha1_props.SHA1.trim().toLowerCase()
+                if ( env.SHA1 && sha1_from_artifact != sha1_trimmed ) {
+                  error message: "SHA1 from artifact (${sha1_from_artifact}) does not match parameter value (${sha1_trimmed})"
+                }
+                println "SHA1=${sha1_trimmed}"
                 env.VERSION = readFile(file: "${WORKSPACE}/dist/version").trim()
                 def shaman_url = "https://shaman.ceph.com/builds/ceph/${env.BRANCH}/${env.SHA1}"
                 def build_description = """\
index 48b041e386c6ad61a53b38356b6314d88abf0b9b..2995d087a87e3dcb8196b2f0f765746b3706e2dc 100644 (file)
           description: "The git branch (or tag) to build"
           default: main
 
+      - string:
+          name: SHA1
+          description: "The specific commit to build"
+
       - choice:
           name: CEPH_REPO
           choices: