I have the following code to search a string and replace it in all deployment.yaml files
sh "find . -name deployment.yaml -exec sed -r -i 's,$project.*,$project:$tag,' {} +"
it works locally but does not seem to work on Jenkins. There is not failure reported too. I do not understand how I can use this?
I am confused on using findFiles
def files = findFiles(glob: '**/deployment.yaml')
//alternative def files = sh(returnStdout: true, script: 'find . -name "deployment.yaml"') leads to nonserializable exeception
files.each {
file -> sh(script:"""sed -r -i 's,$project.*,$project:$tag,' $file""")
}