Skip to content

Commit

Permalink
CASMINST-3421 Build for noos
Browse files Browse the repository at this point in the history
Updates to the `Jenkinsfile.github`, primarily for publishing RPMs to `noos`.
  • Loading branch information
rustydb committed Aug 9, 2023
1 parent a10e08d commit 0d5f32c
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions Jenkinsfile.github
Original file line number Diff line number Diff line change
Expand Up @@ -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+") {
Expand Down Expand Up @@ -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}"
}
}
}
Expand All @@ -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}"
}
}

Expand All @@ -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}"
}
}

Expand All @@ -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",
)
}
}
Expand Down

0 comments on commit 0d5f32c

Please sign in to comment.