diff --git a/Jenkinsfile b/Jenkinsfile index b646f3567..de4a8b68f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,11 +17,10 @@ switch (env.BRANCH_NAME) { } node { - agent any + //env.NODEJS_HOME = "${tool 'node-8.12.0'}" + // on linux / mac + //env.PATH="${env.NODEJS_HOME}/bin:${env.PATH}" - tools { - nodejs 'node' - } stages { stage ('Print environment variables') { echo "Branch ${env.BRANCH_NAME}, build number ${env.BUILD_NUMBER}, environment ${env.NODE_ENV}" @@ -30,12 +29,16 @@ node { checkout scm } stage ('Install Node dependencies') { - sh "npm install --only=prod" - sh "npm install --only=dev" - sh "gulp install" + nodejs('node-8.12.0') { + sh "npm install --only=prod" + sh "npm install --only=dev" + sh "gulp install" + } } stage ('Build project') { - sh "gulp build" + nodejs('node-8.12.0') { + sh "gulp build" + } } stage ('Generating new dockers') { sh "docker build -t vn-loopback:latest ./services/loopback/"