another attempt to build using ubuntu.
This commit is contained in:
		| @@ -19,13 +19,8 @@ pipeline { | ||||
|                 alpine: true, | ||||
|                 [ | ||||
|                     [ | ||||
|                         name: "node-14", | ||||
|                         path: "${repository}/dockerhub/library/node:14", | ||||
|                         command: "/bin/sh" | ||||
|                     ], | ||||
|                     [ | ||||
|                         name: "node-16", | ||||
|                         path: "${repository}/dockerhub/library/node:16", | ||||
|                         name: "ubuntu-focal", | ||||
|                         path: "${repository}/dockerhub/library/ubuntu:focal", | ||||
|                         command: "/bin/sh" | ||||
|                     ] | ||||
|                 ] | ||||
| @@ -50,39 +45,34 @@ pipeline { | ||||
|                             if ! command -v git &> /dev/null; then | ||||
|                                 apk add --no-cache git | ||||
|                             fi | ||||
|                             if ! command -v curl &> /dev/null; then | ||||
|                                 apk add --no-cache curl | ||||
|                             fi | ||||
|                             if ! command -v jq &> /dev/null; then | ||||
|                                 apk add --no-cache jq | ||||
|                             fi | ||||
|                             apk add --no-cache coreutils | ||||
|                         """ | ||||
|                         k8slensVersion = "refs/tags/" + sh ( | ||||
|                         k8slensVersion = sh ( | ||||
|                             script: """ | ||||
|                                 git \ | ||||
|                                     -c \'versionsort.suffix=-\' \ | ||||
|                                     ls-remote https://gitea.smoothnet.org/nhyatt/openlens.git \'v*.*.*\' \ | ||||
|                                 | cut \ | ||||
|                                     --delimiter=\'/\' \ | ||||
|                                     --fields=3 \ | ||||
|                                 | sort \ | ||||
|                                     -u \ | ||||
|                                 | tail \ | ||||
|                                     -n 1 | ||||
|                                 curl \ | ||||
|                                     --location \ | ||||
|                                     --silent \ | ||||
|                                     --fail \ | ||||
|                                     --request GET \ | ||||
|                                     --url https://api.github.com/repos/lensapp/lens/releases/latest | \ | ||||
|                                     jq --raw 'select(.prerelease == false) | .tag_name[1:]' | ||||
|                             """, | ||||
|                             returnStdout: true | ||||
|                         ).trim() | ||||
|                     } | ||||
|                 } | ||||
|                 script { | ||||
|                     if (k8slensVersion ==~ 'refs\\/tags\\/v([5-9]|[0-9]{2,})\\.[0-9]+\\.[0-9]+$') { | ||||
|                         if (k8slensVersion ==~ 'refs\\/tags\\/v5\\.5\\.[0-9]+$') { | ||||
|                             echo "Version (${k8slensVersion}) is valid, we will build it with node 14." | ||||
|                             doBuild = true | ||||
|                             jsNodeID = 'node-14' | ||||
|                         } else if (k8slensVersion ==~ 'refs\\/tags\\/v5\\.6\\.[0-9]+$') { | ||||
|                     if (k8slensVersion ==~ '([5-9]|[0-9]{2,})\\.[0-9]+\\.[0-9]+$') { | ||||
|                         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 if (k8slensVersion ==~ 'refs\\/tags\\/v6\\.[0-9]+\\.[0-9]+$') { | ||||
|                             echo "Version (${k8slensVersion}) is valid, we will build it with node 16." | ||||
|                             doBuild = true | ||||
|                             jsNodeID = 'node-16' | ||||
|                             jsNodeID = 'ubuntu-focal' | ||||
|                         } else { | ||||
|                             echo "Version (${k8slensVersion}) is not valid, we will not build it." | ||||
|                         } | ||||
| @@ -106,7 +96,7 @@ pipeline { | ||||
|                             $class: "GitSCM", | ||||
|                             branches: [ | ||||
|                                 [ | ||||
|                                     name: k8slensVersion, | ||||
|                                     name: "refs/tags/v" + k8slensVersion, | ||||
|                                 ], | ||||
|                             ], | ||||
|                             userRemoteConfigs: [ | ||||
| @@ -140,10 +130,13 @@ pipeline { | ||||
|                 container (jsNodeID) { | ||||
|                     script { | ||||
|                         sh """ | ||||
|                             apt-get update | ||||
|                             apt-get install -y rpm | ||||
|                             rm -rf /root/.npm | ||||
|                             su - node | ||||
|                             apt update | ||||
|                             apt install --no-install-recommends -y curl ca-certificates gcc g++ make git rpm | ||||
|                             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 update | ||||
|                             apt install yarn nodejs | ||||
|                             cd "${workspace}/lens" | ||||
|                             make build | ||||
|                         """ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user