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,466,652
Community Members
 
Community Events
176
Community Groups

elasticimages .bashrc exportes variables not available in scripts

We use vault and need to have it's env vars available to all tasks. In the elasticagent instance startup script I add these vars to /home/bamboo/.bashrc but they are not available in commands to any shell scripts. When I ssh into the instance and su to the bamboo user I see the env variables.

----

...

echo 'export VAULT_ADDR=https://vault.example.net' >> /home/bamboo/.bashrc
echo 'export VAULT_TOKEN="123456-123456-1234-12345-123456" >> /home/bamboo/.bashrc

...

This is not a problem on our remote agents.

2 answers

So, all the scripts we have that needs these env vars will need to source. Not an acceptable solution because security reasons and job isolation for theses variables is not a requirement.  This is only an issue on elasticagents, on our remote agents these, and a few others, environment variables are exported before the agent is started so are available to all jobs. 

0 votes

Bamboo ignores .bashrc user profile when execute tasks as part of build process. All environment variables should come from task configuration, but not agent environment. It's required for build isolation from environment state.

In your case I'd suggest to keep these properties at file somewhere at agent and then read it during script task execution

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events