#!/bin/bash
function run_cmd()
{
cmd=$1
eval $cmd
if [[ $? -eq 0 ]]; then
return
fi
echo "Failed to execute $cmd"
exit 1 //This should be exit and fail the bb pipeline but it will give a successfull message in pipeline after echo
}
export BUCKET_KEY=$(run_cmd "python beanstalk_deploy.py")
Hi team, i want to manually fail my bitbucket pipeline whenever there is some error in my python script. It exits the script but didn't show a failure message.
I have also tried it by using all of these set commands at the start of bash script but also this doesn't works for me.
<span>set</span> <span>-</span><span>euxo pipefail</span>
How can it get rid out of this ?