From 8f31713281018d29cc21e538ff065a5766408fd4 Mon Sep 17 00:00:00 2001 From: nhyatt Date: Wed, 15 Jun 2022 12:34:19 -0500 Subject: [PATCH] if statements need to go in a script block, who knew? --- build-k8s-lenz.jenkins | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/build-k8s-lenz.jenkins b/build-k8s-lenz.jenkins index e211203..b65ea60 100644 --- a/build-k8s-lenz.jenkins +++ b/build-k8s-lenz.jenkins @@ -69,16 +69,18 @@ pipeline { ).trim() } } - if (k8slensVersion ==~ 'refs\\/tags\\/([5-9]|[0-9]{2,})\\.[0-9]+\\.[0-9]+$') { - if (k8slensVersion ==~ 'refs\\/tags\\/5\\.5\\.[0-9]+$') { - echo "Version (${k8slensVersion}) is valid, we will build it with node 14." - jsNodeID = 'node-14' - } else if (k8slensVersion ==~ 'refs\\/tags\\/5\\.6\\.[0-9]+$') { - echo "Version (${k8slensVersion}) is valid, we will build it with node 16." - jsNodeID = 'node-16' + script { + if (k8slensVersion ==~ 'refs\\/tags\\/([5-9]|[0-9]{2,})\\.[0-9]+\\.[0-9]+$') { + if (k8slensVersion ==~ 'refs\\/tags\\/5\\.5\\.[0-9]+$') { + echo "Version (${k8slensVersion}) is valid, we will build it with node 14." + jsNodeID = 'node-14' + } else if (k8slensVersion ==~ 'refs\\/tags\\/5\\.6\\.[0-9]+$') { + echo "Version (${k8slensVersion}) is valid, we will build it with node 16." + jsNodeID = 'node-16' + } + echo "Version (${k8slensVersion}) is not valid, we will not build it." + skipBuild = false } - echo "Version (${k8slensVersion}) is not valid, we will not build it." - skipBuild = false } } }