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

Is there a bamboo builder task for make?

Philip Rittenhouse May 14, 2014

This seems like such a simple and basic feature but I don't see any documention to support builds using makefiles. Have I missed it?

I have tried using the Script task - is that the recommended way of doing it? One problem is that I don't see the script output in the bamboo logs, so if I have a bug in my script it seems I have to debug it blind. Here's an example of a failing case:

14-May-2014 15:18:40 Starting task 'Build for cware' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
14-May-2014 15:18:40
Beginning to execute external process for build 'Magnum Software - V12.X Firmware - Build default #8 (MS-FW-BD-8)'
... running command line:
/bin/sh /tmp/MS-FW-BD-8-ScriptBuildTask-3715787108163851510.sh
... in: /home/snalluri/bamboo-agent-home/xml-data/build-dir/MS-FW-BD/fw_comp
14-May-2014 15:18:40 Failing task since return code of [/bin/sh /tmp/MS-FW-BD-8-ScriptBuildTask-3715787108163851510.sh] was -1 while expected 0
14-May-2014 15:18:40

Finished task 'Build for cware'

2 answers

1 accepted

1 vote
Answer accepted
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 14, 2014

Hi Philip,

Unfortunately, Bamboo does not provide makefile. Said that, I would suggest you the following workaround:

/var/toCompile/hello.c

// hello.c
#include <stdio.h>
 
int main() {
    printf("Hello, world!\n");
    return 0;
}

/var/toCompile/makefile

all: hello.exe

# $@ matches the target; $< matches the first dependent
hello.exe: hello.o
	gcc -o $@ $<

hello.o: hello.c
	gcc -c $<
     
clean:
	rm hello.o hello.exe

Create a Script task under your plan and type in the following under Script Body*:

// The following will do the compile and 
// generate an output.txt within the output from the compiling
make -C /var/toCompile/ > /var/toCompile/output.txt

Create a Script task after the task above and type in the following:

cat /var/toCompile/output.txt

Run your build.

Now you should be able to see the output from your compiling.

Kind regards,
Rafael

Philip Rittenhouse May 15, 2014

Thanks Rafael. I haven't had a chance to try this yet but if the make in the first task fails won't bamboo halt before running the task to cat the output file?

Thanks,

Phil

Marcin Gardias
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 20, 2014

You can make the cat task a 'final' task in which case it will be executed regardless of the results of the previous tasks.

You make a task 'final' by moving it below the grey bar in Tasks list. (as described here: https://confluence.atlassian.com/display/BAMBOO/Configuring+tasks)

Philip Rittenhouse May 20, 2014

Thanks Marcin, that works.

Best regads,

Phil

1 vote
Felipe Kraemer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 14, 2014

Hi Phillip,

Yes, Script task seems to be the correct way of executing Make. Basically, anything that can be manually executed in the Terminal can be executed in Bamboo by using Script tasks.

It looks like the script itself is failing, hence the task fails. Using the Terminal, can you go to this directory:

/home/snalluri/bamboo-agent-home/xml-data/build-dir/MS-FW-BD/fw_comp

And execute:

/bin/sh /tmp/MS-FW-BD-8-ScriptBuildTask-3715787108163851510.sh

Does this work as expected? What's the return code number?

As the script is running in a Remote Agent, its output might not be written in the Bamboo server logs (<Bamboo-Home>/logs/atlassian-bamboo.log). Can you also check:

  • The logs from the Builds in which this problem happens (located in the <Bamboo-Home>/xml-data/builds/ sub-directories);
  • The Remote Agent logs which are generated in the running directory of the Remote Agent. The log file name is usually atlassian-bamboo-agent.log.

If you still cannot determine what's causing this issue, please raise a new Support issue so that we can take a closer look at the logs, and help you troubleshooting this problem.

Kind regards,
Felipe Kraemer
Atlassian Support

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events