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,557,313
Community Members
 
Community Events
184
Community Groups

How can I run python script as a task under Bamboo Build Stages?

I have a python script to parse Bamboo build logs which I would like to run as a post build task to parse build logs.

How can I run python scripts  under Bamboo Build Task?

 

1 answer

1 accepted

1 vote
Answer accepted
rverschoor
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 20, 2016

If your Python script is part of the repository that you check out, you can use a Script Task that runs "python yourscript.py".
replace "python" with the full path of the python executable if it's not in your PATH.

You can also use the Script Task directly with an inline Python script.
This trick works for me on OSX and Linux:

/usr/bin/python <<EOF
print "Hello, World!"
EOF

If you need to run the Python script in the Post Build step you can't use the inline script, you'll have to call "python yourscript.py".

Thanks @Rene Verschoor [Atlassian]. It worked!

rverschoor
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 23, 2016

You're welcome smile

Feel free to hit the "Accept answer" button.

How would you use a virtual env that has been created in a previous step of the plan?

Assume it's available under: 

/opt/bamboo-home/xml-data/build-dir/RTE-RT-CPVE/env

More precise question: Where do you get the previous stage folder from?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events