diff --git a/build-k8s-lenz.jenkins b/build-k8s-lenz.jenkins index 0510837..78a7986 100644 --- a/build-k8s-lenz.jenkins +++ b/build-k8s-lenz.jenkins @@ -19,8 +19,13 @@ pipeline { alpine: true, [ [ - name: "ubuntu-focal", - path: "${repository}/dockerhub/library/ubuntu:focal", + name: "node-14", + path: "${repository}/dockerhub/library/node:14", + command: "/bin/sh" + ], + [ + name: "node-16", + path: "${repository}/dockerhub/library/node:16", command: "/bin/sh" ] ] @@ -48,7 +53,6 @@ pipeline { if ! command -v jq &> /dev/null; then apk add --no-cache jq fi - apk add --no-cache coreutils """ k8slensVersion = sh ( script: """ @@ -66,10 +70,18 @@ pipeline { } script { if (k8slensVersion ==~ '([5-9]|[0-9]{2,})\\.[0-9]+\\.[0-9]+$') { - if (k8slensVersion ==~ '6\\.[0-9]+\\.[0-9]+$') { + if (k8slensVersion ==~ '5\\.5\\.[0-9]+$') { + echo "Version (${k8slensVersion}) is valid, we will build it with node 14." + doBuild = true + jsNodeID = 'node-14' + } else if (k8slensVersion ==~ '5\\.6\\.[0-9]+$') { echo "Version (${k8slensVersion}) is valid, we will build it with node 16." doBuild = true - jsNodeID = 'ubuntu-focal' + jsNodeID = 'node-16' + } else if (k8slensVersion ==~ '6\\.[0-9]+\\.[0-9]+$') { + echo "Version (${k8slensVersion}) is valid, we will build it with node 16." + doBuild = true + jsNodeID = 'node-16' } else { echo "Version (${k8slensVersion}) is not valid, we will not build it." } @@ -88,7 +100,7 @@ pipeline { } steps { script { - dir("lens") { + dir(workspace + "/lens") { checkout ([ $class: "GitSCM", branches: [ @@ -98,7 +110,7 @@ pipeline { ], userRemoteConfigs: [ [ - url: "https://github.com/lensapp/lens.git", + url: "https://gitea.smoothnet.org/nhyatt/openlens.git", ], ], extensions: [ @@ -128,15 +140,8 @@ pipeline { script { sh """ apt-get update - DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install --no-install-recommends -y curl ca-certificates gcc g++ make git rpm tzdata - curl -fsSL https://deb.nodesource.com/setup_16.x | bash - - curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarnkey.gpg > /dev/null - echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list - apt-get update - apt-get install --no-install-recommends -y yarn nodejs - mkdir -p /tmp/npm/cache + DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install --no-install-recommends -y rpm cd "${workspace}/lens" - export npm_config_cache=/tmp/npm/cache make build """ }