]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-dev-pipeline: Mark several vars as Fields
authorZack Cerza <zack@cerza.org>
Mon, 3 Nov 2025 22:51:08 +0000 (15:51 -0700)
committerZack Cerza <zack@cerza.org>
Tue, 4 Nov 2025 19:17:12 +0000 (12:17 -0700)
When variables are defined using 'def' at the top level of a Jenkinsfile, they
are added to the scope local to the generated pipeline function. When they
are defined as Fields, they are instead marked as instance variables of the
encompassing class. As a result, they do not increase the size of the function,
avoiding the MethodTooLargeException. A tradeoff is that their values reset if a
pipeline run is restarted midway, but that's not a feature we are using.

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

index 151bdbefe351104be4c31f5b5c568364d41f9377..7a11ba36c34606d7b5edf6d4d31b8abf98f29dc0 100644 (file)
@@ -1,16 +1,18 @@
-ceph_build_repo = "https://github.com/ceph/ceph-build"
-ceph_build_branch = "main"
-base_node_label = "gigantic"
-ubuntu_releases = [
+import groovy.transform.Field
+
+@Field String ceph_build_repo = "https://github.com/ceph/ceph-build"
+@Field String ceph_build_branch = "main"
+@Field String base_node_label = "gigantic"
+@Field Map ubuntu_releases = [
   "noble": "24.04",
   "jammy": "22.04",
   "focal": "20.04",
 ]
-debian_releases = [
+@Field Map debian_releases = [
   "bookworm": "12",
   "bullseye": "11",
 ]
-build_matrix = [:]
+@Field Map build_matrix = [:]
 
 def get_os_info(dist) {
   def os = [
@@ -38,7 +40,7 @@ def get_os_info(dist) {
   return os
 }
 
-ceph_release_spec_template = '''
+@Field String ceph_release_spec_template = '''
 Name:           ceph-release
 Version:        1
 Release:        0%{?dist}
@@ -92,7 +94,7 @@ install -pm 644 %{SOURCE0} \
 * Mon Apr 28 2025 Zack Cerza <zack@cerza.org> 1-1
 '''
 
-ceph_release_repo_template = '''
+@Field String ceph_release_repo_template = '''
 [Ceph]
 name=Ceph packages for \\$basearch
 baseurl=${repo_base_url}/\\$basearch