Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Inline Python Scripting possible?

Is it possible with inline scripts to be able to use python? I know it does bash scripting just fine, didn't know if there was a plugin that could do inline python or not.

4 answers

1 accepted

0 votes
Answer accepted

Just use:

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

as the inline script body.

Once again... you are amazing. Thanks again

when I tried it, I get this error

<< was unexpected at this time.

Like Anchita Birla likes this


@Przemek Bruski  thank you for your reply

I am still getting error when attempting an python script "inline".  I know your response is straight forward but can you elaborate more on how to achieve a python script inline?

If you want to execute a longer script and use the "Command" task with a Python executable in order to have the Python capability automatically added you can do the following:

  1. Add a script task with code like this:
    cat <<EOF >script.py

    print "Hello, World!"

    EOF
  2. Add a command task with executable "python" and argument "script.py"

Then again, anything non trivial should probably go into a file anyway.

Definitely. You can backup your database. But any build scripts should always be part of your source repository, whenever possible. You don't want to do a lot of 'hidden magic' that exists only in Bamboo Tasks (or any other CI tool for that matter)

python -c "print 'Hello, World!'"

Maybe not the best solution for a large amount of python code. Then again, anything non trivial should probably go into a file anyway.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo Data Center 8.1 is now available

G’day Bamboo customers, Bamboo DC 8.1 is now available with it the following features and programs: SAML 2.0, OpenID Connect, and Crowd SSO In order to help admins with a simplified user manage...

149 views 0 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you