How to append a text to a file in Jenkinsfile injecting Jenkins BUILD_ID
Jenkinsfile
BUILD_ID
I wish to see
version := \"1.0.25\"
The pipeline built in writeFile is also very useful here but requires a read+write process to append to a file.
def readContent = readFile 'build.sbt' writeFile file: 'build.sbt', text: readContent+"\r\nversion := 1.0.${env.BUILD_ID}"