Writing to a json file in workspace using Jenkins

后端 未结 3 780
面向向阳花
面向向阳花 2020-12-31 21:19

I\'ve a jenkins job with few parameters setup and I\'ve a JSON file in the workspace which has to be updated with the parameters that I pass through jenkins.

Example

3条回答
  •  不知归路
    2020-12-31 22:01

    With Pipeline Utility Steps plugin this is very easy to achieve.

        jsonfile = readJSON file: 'path/to/your.json'
        jsonfile['environment'] = 'ENV2'
        writeJSON file: 'path/to/your.json', json: jsonfile
    

提交回复
热议问题