I have a maven dependency graph where each of the dependency has a separate git repository.
I created each as a separate maven job and specified downstream job so that whenever a job gets triggered, the downstream jobs also get triggered recursively.
I want to achieve the same using script.
I created a pipeline script and defined all the nodes as stages.
stages {
stage('A') {
steps {
checkoutAndBuild('A.git', 'A')
}
}
stage('Parallel - B, C') {
parallel {
stage('B') {
steps {
checkoutAndBuild('B.git', 'B')
}
}
stage('C') {
steps {
checkoutAndBuild('C.git', 'C')
}
}
}
}
stage('D') {
steps {
checkoutAndBuild('D.git', 'D')
}
}
}
I want if commit happens in B - only B and D get triggered And if commit happens in A - the whole pipeline gets triggered.
Please suggest if I can achieve the desired behavior using script