This is the Jenkisnfile script currently i am using to run my pipeline for the NodeJS applications. it's working well and suited to my previous pipeline process.
Now I Need to change a little bit in my script for the New Project Requirement.
In the "Step B" if the application failed to start with the NPM Start command, "Step C" (build) does not need to trigger the Job.
Now with this pipeline script approach, "Step C" (build) is always running whether the application failed to start or successfully run because of the parallel block.
pipeline {
agent any
stages {
stage('need to run parallelly'){
steps{
script{
parallel(
a:{
dir('file path'){
bat """
npm install
"""
}
},
b:{
dir('file path'){
bat """
npm start
"""
}
},
"build":{
build job: 'JenkinsTest'
},
)
}
}
}
}