I have written a shell script and I need the same script in python to execute it for windows.
#!/usr/bin/env bash
sonar_token=$1
sonar_server=$2
sonar_project_key=$3
echo "Fetching the Sonar Quality gate status using api"
quality_gatesstatus=$(curl -u $sonar_token: https://$sonar_server/api/qualitygates/project_status?pullRequest=$PullRequestId | grep -Po '"status": *\K"[^"]*"')
echo "the Sonar quality gates for current analysis is: $quality_gatesstatus"
if ("$quality_gatesstatus" != "OK") && ("$quality_gatesstatus" != "NONE")
then
echo "Check Sonar server and fix the issues"
echo $quality_gatesstatus
exit 1
else
echo "No code violations found"
exit 0
fi
I am trying but i am failing to do that, please help us on that.