This is my (example) python script:
!#${bamboo.build.working.directory}/../${bamboo.planKey}/env/bin/python3 <<EOF
print("Hello World")
EOF
This is the error I am getting:
/opt/bamboo-home/temp/RTE-RT-HDR-14-ScriptBuildTask-7622273598056907388.sh: 1: /opt/bamboo-home/temp/RTE-RT-HDR-14-ScriptBuildTask-7622273598056907388.sh: !#/opt/bamboo-home/xml-data/build-dir/RTE-RT-HDR/../RTE-RT/env/bin/python3: not found
I have successfully created the virtualenv in a previous stage. Logging into the machine and executing:
/opt/bamboo-home/xml-data/build-dir/RTE-RT-HDR/../RTE-RT/env/bin/python3
starts python3.
It fails with both Interpreters "Shell" and "/bin/sh or cmd.exe".
Hi Tobias,
Since Bamboo only uses "Shell" and "/bin/sh or cmd.exe" I am suspecting running python commands using the script task won't be possible.
But, I have a workaround:
Also, ensure that you have the python in the path such as :
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
If you find this answer useful, please accept it so that others can also benefit from it.
Thanks,
Robhit
I've done something similar to Rohit (see above). This is how my script looks now:
VIRTUALENV_DIR=/${bamboo.build.working.directory}/../${bamboo.planKey}/env
$VIRTUALENV_DIR/bin/python3 <path_to_script>/script.py
(a previous job has created the virtualenv in the plan directory)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.