diff --git a/Jenkinsfile.github b/Jenkinsfile.github index 3b69d86..583f4cc 100644 --- a/Jenkinsfile.github +++ b/Jenkinsfile.github @@ -25,9 +25,8 @@ */ @Library('csm-shared-library') _ -def sleImage = 'artifactory.algol60.net/csm-docker/stable/csm-docker-sle' -def sleVersion = '15.3' def isStable = env.TAG_NAME != null ? true : false +def sleImage = 'artifactory.algol60.net/csm-docker/stable/csm-docker-sle' pipeline { agent { @@ -48,41 +47,79 @@ pipeline { stages { - stage('Prepare: RPMs') { - agent { - docker { - image "${sleImage}:${sleVersion}" - reuseNode true + stage('Build & Publish') { + + matrix { + + agent { + node { + label "metal-gcp-builder" + customWorkspace "${env.WORKSPACE}/${sleVersion}" + } } - } - steps { - runLibraryScript("addRpmMetaData.sh", "${env.NAME}.spec") - sh "make prepare" - sh "git update-index --assume-unchanged ${env.NAME}.spec" - } - } - stage('Build: RPM') { - agent { - docker { - image "${sleImage}:${sleVersion}" - reuseNode true + axes { + axis { + name 'sleVersion' + values 15.3, 15.4 + } } - } - steps { - sh "make rpm" - } - } - stage('Publish') { - steps { - script { - publishCsmRpms(component: env.NAME, pattern: "dist/rpmbuild/RPMS/noarch/*.rpm", os: "sle-15sp2", arch: "noarch", isStable: isStable) - publishCsmRpms(component: env.NAME, pattern: "dist/rpmbuild/RPMS/noarch/*.rpm", os: "sle-15sp3", arch: "noarch", isStable: isStable) - publishCsmRpms(component: env.NAME, pattern: "dist/rpmbuild/SRPMS/*.rpm", os: "sle-15sp2", arch: "src", isStable: isStable) - publishCsmRpms(component: env.NAME, pattern: "dist/rpmbuild/SRPMS/*.rpm", os: "sle-15sp3", arch: "src", isStable: isStable) + stages { + + stage('Prepare: RPMs') { + agent { + docker { + label 'docker' + reuseNode true + image "${sleImage}:${sleVersion}" + } + } + steps { + runLibraryScript("addRpmMetaData.sh", "${env.NAME}.spec") + sh "make prepare" + sh "git update-index --assume-unchanged ${env.NAME}.spec" + } + } + + stage('Build: RPMs') { + agent { + docker { + label 'docker' + reuseNode true + image "${sleImage}:${sleVersion}" + } + } + steps { + sh "make rpm" + } + } + + stage('Publish: RPMs') { + steps { + script { + sles_version_parts = "${sleVersion}".tokenize('.') + sles_major = "${sles_version_parts[0]}" + sles_minor = "${sles_version_parts[1]}" + publishCsmRpms( + arch: "noarch", + component: env.NAME, + isStable: isStable, + os: "sle-${sles_major}sp${sles_minor}", + pattern: "dist/rpmbuild/RPMS/noarch/*.rpm", + ) + publishCsmRpms( + arch: "src", + component: env.NAME, + isStable: isStable, + os: "sle-${sles_major}sp${sles_minor}", + pattern: "dist/rpmbuild/SRPMS/*.rpm", + ) + } + } + } } } } } -} +} \ No newline at end of file