I have a pipeline with multiple jobs inside it, but I'm facing a dilemma. What is the order of execution of the jobs inside the pipeline? Is it the order from the script? The reason I'm interested is because I want JOB1 to run at the beginning of the pipeline and somewhere in the middle. However, when the pipeline is running JOB1 in the beginning for whatever reason it runs twice in succession. Is there a particular reason for that or am I missing something?
pipeline {
agent any;
options {
timeout(time: 4, unit: 'HOURS')
}
stages {
stage('All tests in parallel')
{
parallel
{
stage('JOB1') {
steps {
callJobByName("JOB1")
}
}
stage('JOB2') {
steps {
callJobByName("JOB2")
}
}
stage('JOB1') {
steps {
callJobByName("JOB1")
}
}
stage('JOB3') {
steps {
callJobByName("JOB3")
}
}
}
}
}
}