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,459,434
Community Members
 
Community Events
176
Community Groups

ANT_HOME being overridden on Bamboo Remote Agent

Edited

Having a weird issue with my Bamboo Remote Agents and ANT_HOME. The TL;DR - Is I have ANT_HOME set for the shell executing the remote agent, however bamboo appears to be overriding it with its own value when executing the ANT task:

 

The Configuration:

 > Bamboo Instance on an Amazon Linux EC2

 > Bamboo Remote Agent on Amazon Linux EC2

     > ant installed via AWS yum repo ( yum -y install ant )

 

The ant executable is installed in /usr/bin/ant , however the etc and lib directories are in /usr/share/ant.

I installed the remote agent using an init.d wrapper, which looks like this:


#!/bin/bash

########################################################
# Wrapper script to execute the Bamboo Remote Agent
# that lives at /opt/atlassian/application-data/bamboo-agent/bin/bamboo-agent.sh
# chkconfig: 2345 20 80
# description: Bamboo Remote Agent Wrapper
########################################################
export RUN_AS_USER=bamboo

export ANT_HOME=/usr/share/ant/
export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk.x86_64/
export BAMBOO_HOME=/opt/atlassian/bamboo/

exec "/opt/atlassian/application-data/bamboo-agent/bin/bamboo-agent.sh" "$@"

 

The agent launches and connects successfully. When trying to build using the Ant Task, we get the "Your ANT_HOME isn't set correctly" error of:

error	13-Aug-2018 14:04:04	Error: Could not find or load main class org.apache.tools.ant.launch.Launcher

 

I embedded a shell task to verify that the ANT_HOME is set in the wrapper of just
    > echo Ant Home: ${ANT_HOME}
And in the logs I see

build	13-Aug-2018 14:04:03	Ant Home: /usr/share/ant/

 

So according to this article: https://confluence.atlassian.com/bamkb/cannot-execute-ant-builds-ant-does-not-launch-213524968.html , I was expecting the remote agent to see ANT_HOME when launching and set it accordingly, but looking at the log for the Ant build task, I see it setting its own ANT_HOME:

using extra environment variables:
... etc
ANT_HOME=/usr
... etc

 

Ant works 100% fine as configured in any users bash shell, so this is definitely something with how bamboo is setting up the execution environment for the ant build task.

 

Any thoughts?

1 answer

0 votes

Hi! 

 

Have you fixed it ?

 

Cheers,

Gonchik Tsymzhitov

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events