attempting another method for skipping stages

This commit is contained in:
Hyatt 2022-06-15 12:22:58 -05:00
parent 2c5a77699e
commit 288bcfec7f
Signed by: nhyatt
GPG Key ID: C50D0BBB5BC40BEA

View File

@ -103,47 +103,63 @@ pipeline {
}
}
if (k8slensVersion ==~ 'refs\\/tags\\/([5-9]|[0-9]{2,})\\.[0-9]+\\.[0-9]+$') {
if (k8slensVersion ==~ 'refs\\/tags\\/5\\.5\\.[0-9]+$') {
jsNodeID = 'node-14'
} else if (k8slensVersion ==~ 'refs\\/tags\\/5\\.6\\.[0-9]+$') {
jsNodeID = 'node-16'
} else {
jsNodeID = 'node-18'
}
stage ('Build K8S Lens') {
steps {
container (jsNodeID) {
script {
sh """
apt-get update
apt-get install -y rpm
cd lens
make build
"""
stage ('Build K8S Lens') {
when {
expression {
if (k8slensVersion ==~ 'refs\\/tags\\/([5-9]|[0-9]{2,})\\.[0-9]+\\.[0-9]+$') {
if (k8slensVersion ==~ 'refs\\/tags\\/5\\.5\\.[0-9]+$') {
jsNodeID = 'node-14'
return true
} else if (k8slensVersion ==~ 'refs\\/tags\\/5\\.6\\.[0-9]+$') {
jsNodeID = 'node-16'
return true
}
return false
}
}
}
steps {
container (jsNodeID) {
script {
sh """
apt-get update
apt-get install -y rpm
cd lens
make build
"""
}
}
}
}
stage ('Push Artifacts') {
steps {
container('alpine') {
script {
def appName = sh (
script: """
printf '%s\\n' "\$(basename "\$(find ./ -name "*.AppImage")")"
""",
returnStdout: true
).trim()
functions.pushArtifact(
repoCreds: "nexus-generic-upload-bot",
fileName: appName,
filePath: workspace + "/lens/dist/",
fileURL: "https://nexus.c.test-chamber-13.lan/repository/generic/appimage/"
)
stage ('Push Artifacts') {
when {
expression {
if (k8slensVersion ==~ 'refs\\/tags\\/([5-9]|[0-9]{2,})\\.[0-9]+\\.[0-9]+$') {
if (k8slensVersion ==~ 'refs\\/tags\\/5\\.5\\.[0-9]+$') {
return true
} else if (k8slensVersion ==~ 'refs\\/tags\\/5\\.6\\.[0-9]+$') {
return true
}
return false
}
}
}
steps {
container('alpine') {
script {
def appName = sh (
script: """
printf '%s\\n' "\$(basename "\$(find ./ -name "*.AppImage")")"
""",
returnStdout: true
).trim()
functions.pushArtifact(
repoCreds: "nexus-generic-upload-bot",
fileName: appName,
filePath: workspace + "/lens/dist/",
fileURL: "https://nexus.c.test-chamber-13.lan/repository/generic/appimage/"
)
}
}
}