I'm trying to concatenate some strings in a Jenkinsfile but it's not working:
def versionFromFile = readFile("./version")
def version = versionFromFile + env.BUILD_NUMBER
I tried other solutions as well:
sh "echo version: ${version}-${env.BUILD_NUMBER}"
sh "git tag ${version}-${env.BUILD_NUMBER}"
but ${env.BUILD_NUMBER} is not evaluated/printed
if I do
sh "git tag 1.0.1-${env.BUILD_NUMBER}"
${env.BUILD_NUMBER} is evaluated/printed
I still don't get how the scripting language works inside the Jenkinsfile, the documentation is all about the DSL, does that means that you can't do common scripting operations?