Branch specific environment variable
I have 2 variables set on the agent
IDEA_15_HOME and IDEA_17_HOME (pointing to 2015 and 2017 installation of IJ)
Branch A needs ideaHome = %env.IDEA_15_HOME% and
Branch B needs ideaHome = %env.IDEA_17_HOME%
These are like 2 master branches in the same repo
I have the build script which needs: -PideaHome=..
I do not want to change the build script because I need branch A and all the branches cut out of A to have IDEA_15_HOME and for B and its sub branches to use IDEA_17_HOME
Where can I specify the ideaHome in the source code or build step.
putting ideaHome in gradle.properties in the project does not work as it has lower preference than the user's gradle.properties in /user/home..
Can I put it somewhere.. like in build.gradle? but the build script on teamcity is parsed first so it cannot resolve teh variable in build.gradle?
If there is any way, could you please let me know..
Thank you
Please sign in to leave a comment.
Hi Vikas,
Gradle scripts can read TeamCity's properties, so you can set up a property within the build configuration and then read it from your build.gradle script to assign the variable to the right name. More info here: https://confluence.jetbrains.com/display/TCD10/Gradle#Gradle-Buildproperties