Running Gradle build using bamboo.

Our android app is being build using Gradle. I'm currently evaluating Bamboo for this project. Jenkins does have plugin to run Gradle build. However, I'm not sure if Bamboo run Gradle build. One of the question on Atlassian answers that it is available but it is on demand.

https://answers.atlassian.com/questions/176820/gradle-support-for-bamboo

What is the status of this support ? Is it still on demand ? Does this on demand plugin support all Gradle to the fullest ?

11 answers

I am also very interested in a gradle integration. Currently I have to use the scripting features in combination with the gradle wrapper. (a graddle (wrapper) task would be nice).

You can use the gradle wrapper (./gradlew) to execute gradle. I'm doing the same thing :)

Be aware that the documentation is catastrophically wrong with Bamboo >= 5.0. There are all kinds of bugs and missing features that I'm sorting out. One of them is that the Bash property export doesn't function at all.

Quick Setup Guide


Use this script (e.g. for Gradle 2.5):

mkdir -p ~/mnt/bamboo-ebs/gradle && cd $_

wget https://services.gradle.org/distributions/gradle-2.5-bin.zip

unzip gradle-2.5-bin.zip

Then take a new snapshot from the EBS volume and use this in your elastic agent.

Afterwards add "Executable Capability" to your image configuration with this as path:

/mnt/bamboo-ebs/gradle/bin/gradle

Now you can use Gradle as Command in Build plans and add the task name as argument - e.g. "build".

Oliver, not sure how your solution work, can you please describe with reference of following issue.

I install an trial version of Bamboo and setup rest of work include path of Git-Repo and all. Now issue is my Android Project used Gradle as build system but there is no direct support in Bamboo for this. Then what I need to add in "Script configuration" to make it happened.

Any suggestion here !

Oliver, adding to chmod +x gradlew as script file worked for successful build. But that is not generating any output build (.apk in Android case). Any Suggestion !!

Any updates on Gradle <> Bamboo integration?? We are really looking forward to it!!

Groovy Task for Bamboo has Gradle and Gradle wrapper tasks. Not currently available for OnDemand however.

For what it's worth...we build with gradle daily for one of our projects (one of the larger projects we have) but use a script to execute the build. We have a gradleprojectbuild.cmd script which we call from bamboo. We weren't able to get the plugin to work with this project (but then this project may not be typical so don't blame the plugin). We are using the download version of bamboo, but the build script is hosted in our repository and accessible with the rest of the source within the plan build workspace.

If you can build it from the command line you can likely build it with bamboo.

@GretchenRunning gradle with command script is interesting to me. I like your comment that "if you can build it from the command line you can likely build it with bamboo".  I want to run just plain-vanilla gradle tasks without a plugin. I script is fine. Can you share the basic script?  

See Gary Hellman's post below.  Using the gradle wrapper is pretty much how the teams I mentioned are doing this.

Any updates on this? I would love to see a gradle integration for bamboo.

I really want to implement gradle with Bamboo, I want to know what needs to be done to do this.

Rohit, checked with this thread. I added this as Script and this help me to build successful. But not generating any build output (.apk in case of Android). Let me know if you got any success here !!

One way to use gradle in bamboo - use the gradlew wrapper. (as Dustin Barnes mentions above)

Use a script plugin - The script (after checking out source code) might be "./gradlew clean build"  (or gradlew.bat)

One tricky thing is to make sure the "gradle/wrapper/gradle-wrapper.jar" file is forced to be checked in

(e.g., "git add -f gradle/wrapper/gradle-wrapper.jar") and checkin ".gradle/*" v2.13 perhaps

Also - I checked that the build worked on a laptop first - whatever your environment is ...

I'm using the Artifactory for Bamboo Plugin for running Gradle Tasks in my Bamboo Jobs and I've not had any problems with it. It's got a simple checkbox for the Bamboo Jobs to use the Gradle Wrapper bundled into the project rather than the Gradle version installed on the build machine.

There's also the Groovy Tasks for Bamboo Plugin but I've not used that one.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in United States

Atlassian Certification

Hello, Today it is about Atlassian Certification. Do you have an interest in taking the exam? If yes share with us so if we have couple people we can start a group study. All the best,   ...

29 views 3 1
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you