From 0d5f32cd778ba188bf8e451a1568185eafd2cd98 Mon Sep 17 00:00:00 2001 From: Russell Bunch Date: Wed, 9 Aug 2023 10:31:51 -0500 Subject: [PATCH] CASMINST-3421 Build for noos Updates to the `Jenkinsfile.github`, primarily for publishing RPMs to `noos`. --- Jenkinsfile.github | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/Jenkinsfile.github b/Jenkinsfile.github index 99c7138..8251562 100644 --- a/Jenkinsfile.github +++ b/Jenkinsfile.github @@ -25,7 +25,7 @@ */ @Library('csm-shared-library') _ -def pythonImage = 'artifactory.algol60.net/csm-docker/stable/csm-docker-sle-python' +def pythonImage = 'artifactory.algol60.net/csm-docker/stable/csm-docker-sle-python:3.10' // Disable pr-merge builds; not used. if (env.BRANCH_NAME ==~ ~"^PR-\\d+") { @@ -69,23 +69,19 @@ pipeline { name 'ARCH' values 'x86_64', 'aarch64' } - axis { - name 'PYTHON_VERSION' - values '3.10', '3.9' - } } environment { DOCKER_ARCH = sh(returnStdout: true, script: "[ ${ARCH} == 'x86_64' ] && echo -n 'amd64' || echo -n 'arm64'") - BUILD_DIR = "${env.WORKSPACE}/dist/rpmbuild/${ARCH}/${PYTHON_VERSION}" + BUILD_DIR = "${env.WORKSPACE}/dist/rpmbuild/${ARCH}/" } stages { stage('Build: setup') { steps { lock('docker-image-pull') { - sh "docker pull --platform linux/${DOCKER_ARCH} ${pythonImage}:${PYTHON_VERSION}" - sh "docker tag ${pythonImage}:${PYTHON_VERSION} ${pythonImage}:${PYTHON_VERSION}-${DOCKER_ARCH}" + sh "docker pull --platform linux/${DOCKER_ARCH} ${pythonImage}" + sh "docker tag ${pythonImage} ${pythonImage}-${DOCKER_ARCH}" } } } @@ -95,8 +91,8 @@ pipeline { docker { label "${PRIMARY_NODE}" reuseNode true - args "-v /home/jenkins/.ssh:/home/jenkins/.ssh --platform linux/${DOCKER_ARCH}" - image "${pythonImage}:${PYTHON_VERSION}-${DOCKER_ARCH}" + args "--platform linux/${DOCKER_ARCH}" + image "${pythonImage}-${DOCKER_ARCH}" } } @@ -121,8 +117,8 @@ pipeline { docker { label "${PRIMARY_NODE}" reuseNode true - args "-v /home/jenkins/.ssh:/home/jenkins/.ssh --platform linux/${DOCKER_ARCH}" - image "${pythonImage}:${PYTHON_VERSION}-${DOCKER_ARCH}" + args "--platform linux/${DOCKER_ARCH}" + image "${pythonImage}-${DOCKER_ARCH}" } } @@ -143,29 +139,25 @@ pipeline { label "${PRIMARY_NODE}" reuseNode true args "-v /home/jenkins/.ssh:/home/jenkins/.ssh --platform linux/${DOCKER_ARCH}" - image "${pythonImage}:${PYTHON_VERSION}-${DOCKER_ARCH}" + image "${pythonImage}-${DOCKER_ARCH}" } } steps { script { - def sleVersion = sh(returnStdout: true, script: 'awk -F= \'/VERSION_ID/{gsub(/["]/,""); print \$NF}\' /etc/os-release').trim() - def sles_version_parts = "${sleVersion}".tokenize('.') - def sles_major = "${sles_version_parts[0]}" - def sles_minor = "${sles_version_parts[1]}" publishCsmRpms( arch: "${ARCH}", component: env.NAME, isStable: isStable, - os: "sle-${sles_major}sp${sles_minor}", - pattern: "dist/rpmbuild/${ARCH}/${PYTHON_VERSION}/RPMS/${ARCH}/*.rpm", + os: "noos", + pattern: "dist/rpmbuild/${ARCH}//RPMS/${ARCH}/*.rpm", ) publishCsmRpms( arch: "src", component: env.NAME, isStable: isStable, - os: "sle-${sles_major}sp${sles_minor}", - pattern: "dist/rpmbuild/${ARCH}/${PYTHON_VERSION}/SRPMS/*.rpm", + os: "noos", + pattern: "dist/rpmbuild/${ARCH}//SRPMS/*.rpm", ) } }