Reputation: 1549
In Jenkins you can easily create a list view with the Job DSL
listView("myView") {
jobs {
regex(".*")
}
}
but if you try to create a list view within a folder, the folder will be created but not the view
folder("someFolder")
listView("someFolder/myView") {
jobs {
regex(".*")
}
}
Is there a way to accomplish this?
Upvotes: 5
Views: 5907
Reputation: 1549
This occurs when a Job DSL performs operations in this order:
The reason this happens is that views live in the config file for a folder. When you re-generate a folder, it deletes any configured views for that folder.
To fix this issue in my case, I removed any duplicate folder creation so that each folder was only created once.
Upvotes: 4
Reputation: 9
Please use a relative path to create Jobs or pipeline;
jobDsl lookupStrategy: 'SEED_JOB',
targets: ['src/jobs/**/*.groovy'].join('\n')
Upvotes: -2