You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there. I had an issue with failing builds on CI when quality gate is violated. I found the reason in using run-sonar.sh script which returns other value then the sonar-runner itself. I looked through the script and found the problem: if -v option is specified then script returns the result of command:
elif [ "$vflag" = "on" ]; then
...
if [[ $returnValue != 0 && $returnValue != 5 ]] ; then
stopProgress
echo "ERROR - Command '$command $@' failed with error code: $returnValue"
exit $returnValue
fi
But otherwise it returns the result of the previous operation ($?) instead:
else
...
if [[ $returnValue != 0 && $returnValue != 5 ]] ; then
stopProgress
echo "ERROR - Command '$command $@' failed with error code: $returnValue"
exit $?
So in default mode the echo return value is used instead of the sonar-runner result and it is usually a zero. Is it a mistake or a feature? Maybe I'm missing something.
The text was updated successfully, but these errors were encountered:
Gimungagap
changed the title
Why error
run-sonar.sh always returns zero by default
Oct 1, 2015
Gimungagap
changed the title
run-sonar.sh always returns zero by default
run-sonar.sh always returns zero exit code by default
Oct 1, 2015
Hi there. I had an issue with failing builds on CI when quality gate is violated. I found the reason in using run-sonar.sh script which returns other value then the sonar-runner itself. I looked through the script and found the problem: if -v option is specified then script returns the result of command:
But otherwise it returns the result of the previous operation ($?) instead:
So in default mode the echo return value is used instead of the sonar-runner result and it is usually a zero. Is it a mistake or a feature? Maybe I'm missing something.
The text was updated successfully, but these errors were encountered: