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]+$') { stage ('Build K8S Lens') {
if (k8slensVersion ==~ 'refs\\/tags\\/5\\.5\\.[0-9]+$') { when {
jsNodeID = 'node-14' expression {
} else if (k8slensVersion ==~ 'refs\\/tags\\/5\\.6\\.[0-9]+$') { if (k8slensVersion ==~ 'refs\\/tags\\/([5-9]|[0-9]{2,})\\.[0-9]+\\.[0-9]+$') {
jsNodeID = 'node-16' if (k8slensVersion ==~ 'refs\\/tags\\/5\\.5\\.[0-9]+$') {
} else { jsNodeID = 'node-14'
jsNodeID = 'node-18' return true
} } else if (k8slensVersion ==~ 'refs\\/tags\\/5\\.6\\.[0-9]+$') {
jsNodeID = 'node-16'
stage ('Build K8S Lens') { return true
steps {
container (jsNodeID) {
script {
sh """
apt-get update
apt-get install -y rpm
cd lens
make build
"""
} }
return false
} }
} }
} }
steps {
container (jsNodeID) {
script {
sh """
apt-get update
apt-get install -y rpm
cd lens
make build
"""
}
}
}
}
stage ('Push Artifacts') { stage ('Push Artifacts') {
steps { when {
container('alpine') { expression {
script { if (k8slensVersion ==~ 'refs\\/tags\\/([5-9]|[0-9]{2,})\\.[0-9]+\\.[0-9]+$') {
def appName = sh ( if (k8slensVersion ==~ 'refs\\/tags\\/5\\.5\\.[0-9]+$') {
script: """ return true
printf '%s\\n' "\$(basename "\$(find ./ -name "*.AppImage")")" } else if (k8slensVersion ==~ 'refs\\/tags\\/5\\.6\\.[0-9]+$') {
""", return true
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/"
)
} }
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/"
)
} }
} }
} }