Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bamboo script task puts "/bin" in front of $PATH and causes problems.

I am using Bamboo 6.4.  I inserted a Script task to compile my project.  But due to the fact that "/bin" is inserted in front of the $PATH the wrong g++ / gcc compiler is used and generated errors.  I have installed gcc devtoolset-7 and want to use that version of the compiler. 

Is this expected behavior of the Script task - insert /bin in front of the $PATH.

To fix this issue, I had to insert this in the Inline Script Body:

#!/bin/bash
# Bamboo for some reason pust /bin first in PATH, therefore wrong g++ compile used.
# Therefore, have to put path to proper devtoolset first here.
export PATH=/opt/rh/devtoolset-7/root/usr/bin:$PATH:.

1 answer

0 votes

Hi @Samuel Santiago

According to my recent tests Bamboo will not deliberately add the /bin folder in your path. I did notice that a remote agent may add the JAVA path to the PATH variable which probably would not be an issue for you.

The PATH and other variables will be inherited as described below:

  • CASE 1 - local agents
    They are only different threads and will have the same set of variables available in the parent process who started the Bamboo server.
  • CASE 2 - remote agents
    They are a different process and will get the variables from the parent process starting the agent.
    ⚠️Keep in mind that if your agent starts as a service it will get the variables available for the user starting that service.


What I would check:

  1. Are you running this build in a remote agent?
  2. Do you get a different result when using a different agent?
  3. If you start an agent from the terminal (not as a service) and the PATH is correctly set, do you get any changes when the script runs in Bamboo?
    For this one, you need to make sure you restart your agent when you change the variable.

I'll wait for your comments.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

223 views 4 6
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you