I have this jenkins stage where I am trying to pass a paramter to a gradle task. It seems like the gradle task does not recieve it
Jenkins
stage('Version Bump') {
steps {
script {
version = (new Date().format('YYYY.ww.')) + env.BUILD_NUMBER
sh './gradlew bumpVersion --no-daemon -Pversion=${version}'
}
}
}
Gradle task
task bumpVersion() {
doFirst {
println version
}
}
The version isnt printed. I have confirmed the value is correct by echo-ing in the jenkins file.