-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
Jenkins (Windows) - versions 2.138.3 and 2.150.3
Content Replace Plugin 1.0.4
Nodes = Win2016
The script below works to find and update a file if the file exists in the workspace on the Jenkins master. When updating the label to run on a node, and ensuring the file does in fact exist in the workspace of the node, the script fails stating that that the file does not exist.
In case it matters, the jobs are managed in a Jenkins folder.
java.io.FileNotFoundException: File 'C:\jenkins\workspace\Pipeline-Tests\Content-Replace-Test\here.txt' does not exist
at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:299)
at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1711)
Pipeline with Sequential Steps
pipeline{ agent none stages { stage ("Do Stuff") { agent { label 'master' } stages { stage ("Test") { steps { echo 'Replace...' contentReplace(configs: [fileContentReplaceConfig(configs: [fileContentReplaceItemConfig(matchCount: 1, replace: "versionName-replace", search: 'versionName.*')], fileEncoding: 'ASCII', filePath: 'here.txt')]) } } } } } }