The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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.
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, If you are running self-managed environments and looking to adopt modern infrastructure, Bamboo Data Center can now be deployed in a Kubernetes cluster. By leveraging Kubernetes, you can easily...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.