Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve credentials on multibranch pipeline jobs #117

Open
samrocketman opened this issue Apr 17, 2018 · 0 comments
Open

Preserve credentials on multibranch pipeline jobs #117

samrocketman opened this issue Apr 17, 2018 · 0 comments

Comments

@samrocketman
Copy link
Owner

samrocketman commented Apr 17, 2018

Multibranch pipelines overwrite their own configuration. If the configuration exists, then we want to preserve some specific values. For example, credentials or other configurations.

Here's an example of getting existing credentials and converting it to XML as plain text.

import hudson.util.DescribableList
import hudson.util.XStream2
import jenkins.model.Jenkins

XStream2 xs = new XStream2()
xs.alias('properties', DescribableList.class)
xs.toXML(Jenkins.instance.getItemByFullName('samrocketman/jervis').properties)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant