I am trying to access the bamboo build number in build.gradle but am unable to access it there. Following are the options I have tried so far inside build.gradle
:
System.getenv ()["bamboo.buildNumber"]
System.getenv ()["bamboo_buildNumber"]
project.hasProperty("bamboo_buildNumber")
project.hasProperty("bamboo_buildNumber")
I even tried creating a variable for my build plan with variable name as BUILD_NUMBER and variable value as ${bamboo.buildNumber}
and accessed it using the below methods, but the values are not getting accessed.
System.getenv ()["BUILD_NUMBER"]
project.hasProperty("BUILD_NUMBER")