You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I have a Script task in my Deployment project that executes some shell commands. I want this shell command to have access to a Bash environment variable (Not a Bamboo variable).
If I was running this script manually at the command line I would export the variable in my .bashrc and it would be available to the script. How can I achieve the same thing when the script is running inside Bamboo?
Hi Devang,
Thanks for your question!
Try using like this:
source ~/.bashrc
echo $variable
Please accept the answer if it helps you so that others can also make use of it.
Thanks,
Robhit
Hi Rohit,
Do you mean add a "source" line to my deployment task? I have about 30 tasks, I was hoping I could have the task access system environment variables without going in to each one and editing them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dewang,
You could also try to add the variables in the ".bash_profile" or the ".profile" then it will be available.
Thanks,
Robhit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've already added the variable to the .profile but it doesn't get picked up when the task is running inside Bamboo. Is there any other change that needs to be made? Do I need to restart the Bamboo server?
Just to clarify - this is an _inline_ Script task running as part of a Deployment project
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.