Bamboo build successful for code with compilation errors

Hi,

I'm evaluating Bamboo for my company. I am trying to build an android project (IDE is Android Studio 2.1.3) with a gradle wrapper. I have introduced a compilation error in the code (e.g. missing ";" after a statement). The log file states that the build failed due to this error. However, Bamboo updates that the build was successful in the dashboard, job summary and even in JIRA.

The build.gradle of my application is as follows:

buildscript {

    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        jcenter()
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}
gradle.buildFinished {
	buildResult ->
	if(buildResult.failure) {
		return 1;
	}
}

I found https://ruijarimba.wordpress.com/2016/02/07/powershell-scripts-running-on-bamboo-dont-return-the-correct-exit-code/ which suggests to add the following code in the powershell.

trap
{
    write-output $_
    exit 1
}
But still did not work for me.

Can someone please help me on this issue?

2 answers

0 vote

Please contact Bamboo Support, don't forget to provide the screenshots of your task configuration.

I figured out that in bamboo when I change the interpreter of the inline script from Windows Powershell to /bin/sh or cmd.exe, bamboo build failed and the error was detected in the logs. 

image2016-9-15 11:56:43.png

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,793 views 0 6
Read article

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