Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,975
Community Members
 
Community Events
184
Community Groups

Does bamboo allow a plan variable to point to another variable referencing a system property?

In my build script I am referencing a system variable gradle_home. I want to substitute this with a bamboo variable so that I can override this value for a specific branch. However the build runs on different systems and the only way to reliably get the gradle_home for the system is via the system.gradle_home. So I am trying to get the bamboo variable to point to the system variable in normal case and to the new path in the overridden case. Is this possible?

1 answer

1 accepted

0 votes
Answer accepted
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 13, 2022

Hello @Robins John

Welcome to Atlassian Community!

Choosing which variable to use is up to the application, not Bamboo. What you can do is set a script task that would evaluate if the custom variable is set and then overwrite the system.GRADLE_HOME if needed. You can do something like this:

Assuming:

  • ${system.GRADLE_HOME} (the one inherited from your OS)
  • ${bamboo.GRADLE_HOME} (the one declared on the Plan)

Add a Script task that will evaluate the variable and call Gradle:

#!/bin/bash

if [ -n "${bamboo_GRADLE_HOME}" ] ; then
export GRADLE_HOME=${bamboo_GRADLE_HOME}
fi

${GRADLE_HOME}/bin/gradle build

More information:

Cheers,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Thanks Eduardo. Your input certainly helped!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events