mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
Refactor Jenkinsfile to use tools block for Node.js
This commit is contained in:
21
Jenkinsfile
vendored
21
Jenkinsfile
vendored
@@ -1,11 +1,9 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
NODE_VERSION = '20.11.1'
|
||||
NODE_DIST = "node-v${NODE_VERSION}-linux-x64"
|
||||
NODE_HOME = "${WORKSPACE}/${NODE_DIST}"
|
||||
PATH = "${NODE_HOME}/bin:${env.PATH}"
|
||||
tools {
|
||||
nodejs 'node20'
|
||||
jdk 'jdk17'
|
||||
}
|
||||
|
||||
options {
|
||||
@@ -19,19 +17,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('Download Node') {
|
||||
steps {
|
||||
sh '''
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y xz-utils
|
||||
curl -fsSLO https://nodejs.org/dist/v${NODE_VERSION}/${NODE_DIST}.tar.xz
|
||||
tar -xJf ${NODE_DIST}.tar.xz
|
||||
node --version
|
||||
npm --version
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Install') {
|
||||
steps {
|
||||
sh 'npm ci'
|
||||
|
||||
Reference in New Issue
Block a user