How to persist Properties in jenkins pipeline? How to persist Properties in jenkins pipeline? jenkins jenkins

How to persist Properties in jenkins pipeline?


you can use yaml format instead of properties.

it also simple and human readable and in jenkins-pipeline there are read and write operations for yaml

or you can use this kind of code:

@NonCPSdef propsToString(Map map){    return new StringWriter().with{w-> (map as Properties).store(w, null); w; }.toString()}writeFile file: propertiesPath, text: propsToString(props)