Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Bamboo build number in build.gradle

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")
like image 952
Uday Avatar asked Nov 10 '15 06:11

Uday


1 Answers

I got the variable value using - System.getenv ()["bamboo_buildNumber"]

like image 133
Uday Avatar answered Sep 22 '22 17:09

Uday