-
Bug
-
Resolution: Fixed
-
Major
-
Jenkins=2.32.3
Jobdsl=1.63
Folders=6.0.4
CredentialsPlugin=2.1.13
-
-
job-dsl-plugin 1.78, job-dsl-plugin 1.80
When using job-dsl-plugin to create a folder
folder(my_folder) {
displayname("my_folder_name")
}
If the folder exists with Credentials attached to it, they are lost on recreation . Is there anyway to wrap this in a conditional? if!(folder(my_folder) {blah..blah....}. I believe the desired behaviour here is to not blow away the credentials attached at the folder level.
- is related to
-
JENKINS-57435 Cannot configure SSH credentials via Job DSL
-
- Resolved
-
[JENKINS-44681] JobDSL Folder Creation Destroys Credentials
Resolution | New: Not A Defect [ 7 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Status | Original: Resolved [ 5 ] | New: Closed [ 6 ] |
Resolution | Original: Not A Defect [ 7 ] | |
Status | Original: Closed [ 6 ] | New: Reopened [ 4 ] |
Comment | [ This is a bug , folder meta data should remain as is ] |
The credentials on folder level are stored in the folder configuration. When a folder is generated by Job DSL, the whole configuration is replaced by the configuration described in Job DSL. So the credentials get lost, when running the seed job.
I do not recommend to specify credentials in DSL scripts. But you can use the Jenkins API to copy the existing credentials configuration to the Job DSL definition: