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
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
Hello. I'm currently evaluating Bamboo for our build equipment. We have mostly python scripts to run different steps. My current issue is, how I can access global and/or plan specific variables by the python scripts, if they are called by a remote agent?
I read your documentation about the usage of global variables but I don't see the link to python. I wouldn't like to use an environment variable because this must be defined for each task. I'm looking for a solution which works for a entire plan, where I can access e.g. on the subversion revision number or the build number.
Thanks for any help.
Bamboo wil pass down any build specific variable/global variable you have defined to your build. If you don't want to specify a global Bamboo variable then you can specify a plan specific variable as per;
You can then access this variables using a simlar code;
Hope that help! Let me know if you have any question?
os.environ['bamboo.repository.revision.number'] does not work for me in python. I am getting the below error.
File "/usr/lib/python2.7/UserDict.py", line 23, in __getitem__
For anyone who's bothering with the similar problem: in Python ran on Bamboo the os.environ contains Bamboo's variables in form where every dots are replaced with underscores, e.g. variable "bamboo.build.working.directory" should be resolved as: os.environ["bamboo_build_working_directory"]
i still get error not sure why.
i get error
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
File "/usr/lib64/python2.6/UserDict.py", line 22, in __getitem__
Is there a way to successfully invoke bamboo plan variables within a python inline script just like it works for a shell or batch script.
Any help here would be greatly appreciated.