Jaime Ramírez
2020-06-17 29728c4f80f139b717e11ebcec9cbb78f31fded5
commit | author | age
424389 1 node {
JR 2     stage('Check changes') {
3         checkout scm
4     }
5
6     // TODO: Jenkins can't execute pipelines for more than one project in the same run.
7     // The CI task will fail if the change set includes changes across several projects
8     // Ideas?
0522e0 9     // Changesets approach is not working as expected... TODO: Fix
JR 10     // runIfChanged('adopt-a-pup/web-app/')
11     
12     load "adopt-a-pup/web-app/Jenkinsfile"
424389 13 }
JR 14
15
16 @NonCPS
17 def runIfChanged(projectDir) {
18     for (changeSet in currentBuild.changeSets) {
19         for (changeItems in changeSet.getItems()) {
20             for (file in changeItems.getAffectedFiles()) {
21                 if (file.getPath().startsWith(projectDir)) {
22                     load "$projectDir/Jenkinsfile"
23                 }
24             }
25         }
26     }
27     return false
28 }