A plugin for Jenkins allows you to replace file content with regex expressions.
- Regex expression for search. e.g. (Version=)([0-9]+\.[0-9]+\.[0-9]+)
- You can use variables enclosed in ${}
Jenkins version 2.204.6 or newer is required.
contentReplace(
configs: [
fileContentReplaceConfig(
configs: [
fileContentReplaceItemConfig(
search: '(Version=)([0-9]+\\.[0-9]+\\.[0-9]+)',
replace: '$11.0.${BUILD_ID}',
matchCount: 1,
verbose: false,
)
],
fileEncoding: 'UTF-8',
'versions.txt'
)
]
)
- Add, support verbose output control
- Update the required version of Jenkins to v2.204.6
- Add, support filepath of Ant path style
- Fixed, contentReplace does not appear in the Snippet Generator
- enables RegEx multiline mode
- print replace lines info
- beautify log
- Move docs to GitHub
- New, make failure immediately
- Fixed, match count
- Fixed, close InputStream after read the file‘s content
- Fixed, matchCount not to be reset to 1 When editing the configuration file again
- Fixed, support windows slave, linux master
- Fixed, support for absolute path file
- Fixed, matchCount not to be reset to 1 When editing the configuration file again
- "File path" can be configured using variables
- Add "Match count" config
- Simply replace the contents of the specified encoded file