nodejs tool

This commit is contained in:
Joan Sanchez 2018-10-24 14:40:18 +02:00
parent e7ead4be1c
commit 78bda2c795
1 changed files with 11 additions and 8 deletions

19
Jenkinsfile vendored
View File

@ -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/"