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'
|
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.