]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-dev-pipeline-trigger: use @Field for top-level variable 2643/head
authorDavid Galloway <david.galloway@ibm.com>
Tue, 7 Jul 2026 13:41:27 +0000 (09:41 -0400)
committerDavid Galloway <david.galloway@ibm.com>
Tue, 7 Jul 2026 13:54:50 +0000 (09:54 -0400)
The Declarative script splitting transformation being enabled on the
controller rejects pipelines that declare top-level local variables.
Convert the params list to a @Field, renamed to build_params to avoid
clobbering Jenkins pipeline's 'params' predefined global variable.

Signed-off-by: David Galloway <david.galloway@ibm.com>
ceph-dev-pipeline-trigger/build/Jenkinsfile

index 3a19e8f3e7cbf6c3e058c71b7c5a1e2c71404381..32604acceaa4443a0c0ee0851c594545b059316f 100644 (file)
@@ -1,3 +1,5 @@
+import groovy.transform.Field
+
 JOB = "ceph-dev-pipeline"
 VALID_PARAMETERS = [
   "CEPH_BUILD_BRANCH",
@@ -10,7 +12,7 @@ VALID_PARAMETERS = [
   "FLAVOR",
   "SCCACHE",
 ]
-def params = []
+@Field List build_params = []
 
 pipeline {
   agent any
@@ -33,12 +35,12 @@ pipeline {
             }
           }
           def branch = env.ref.replace("refs/heads/", "")
-          params.push(string(name: "BRANCH", value: branch))
+          build_params.push(string(name: "BRANCH", value: branch))
           println("Looking for parameters: ${VALID_PARAMETERS}")
           for (key in VALID_PARAMETERS) {
             value = paramsMap[key]
             if ( value ) {
-              params.push(string(name: key, value: value))
+              build_params.push(string(name: key, value: value))
               println("${key}=${value}")
             }
           }
@@ -50,7 +52,7 @@ pipeline {
         script {
           build(
             job: JOB,
-            parameters: params
+            parameters: build_params
           )
         }
       }