]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-dev-pipeline: Simplify anyOf/allOf block less-whens
authorDavid Galloway <david.galloway@ibm.com>
Tue, 28 Oct 2025 21:20:13 +0000 (17:20 -0400)
committerDavid Galloway <david.galloway@ibm.com>
Tue, 28 Oct 2025 21:27:11 +0000 (17:27 -0400)
Avoids `General error during class generation: Method too large: WorkflowScript.___cps___5351 ()Lcom/cloudbees/groovy/cps/impl/CpsFunction;`

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

index 978e682a8e1a6468c63a57e30a88fcfc22ff91a2..782d6dc32cb2d7772f5f2fc9b0c83423a1b15437 100644 (file)
@@ -12,6 +12,10 @@ debian_releases = [
 ]
 build_matrix = [:]
 
+def parseList = { raw ->
+  (raw ?: '').split(/[,\s]+/).findAll { it }.collect { it.trim() }
+}
+
 def get_os_info(dist) {
   def os = [
     "name": dist,
@@ -170,20 +174,20 @@ pipeline {
         }
         when {
           beforeAgent true
-          allOf {
-            expression { env.DISTROS.contains(env.DIST) }
-            expression { env.ARCHS.contains(env.ARCH) }
-            expression { env.FLAVORS.contains(env.FLAVOR) }
-            anyOf {
-              environment name: "CI_COMPILE", value: "true"
-              allOf {
-                environment name: "CI_CONTAINER", value: "true"
-                anyOf {
-                  environment name: "DIST", value: "centos9"
-                  environment name: "DIST", value: "rocky10"
-                }
-              }
-            }
+          expression {
+            def distros  = parseList(env.DISTROS)
+            def archs    = parseList(env.ARCHS)
+            def flavors  = parseList(env.FLAVORS)
+        
+            def distOk   = distros.contains(env.DIST)
+            def archOk   = archs.contains(env.ARCH)
+            def flavorOk = flavors.contains(env.FLAVOR)
+        
+            // rpm-building distros
+            def isRpmDist = ['centos9', 'rocky10'].contains(env.DIST)
+        
+            distOk && archOk && flavorOk &&
+            ( env.CI_COMPILE == 'true' || (env.CI_CONTAINER == 'true' && isRpmDist) )
           }
         }
         axes {
@@ -607,10 +611,8 @@ pipeline {
           }
           stage("container") {
             when {
-              allOf {
-                environment name: 'CI_CONTAINER', value: 'true'
-                expression { ['centos9', 'rocky10'].contains(env.DIST) }
-              }
+              beforeAgent true
+              expression { env.CI_CONTAINER == 'true' && (env.DIST == 'centos9' || env.DIST == 'rocky10') }
             }
             environment {
               CONTAINER_REPO_CREDS = credentials('quay-ceph-io-ceph-ci')