Skip to content

Commit f9b6dff

Browse files
Badal Kumar PrustyBadal Kumar Prusty
authored andcommitted
update the script to handel existing scripts
1 parent d8dc0aa commit f9b6dff

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scripts/sql/220_exposing_sonarqube_image.up.sql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ if [[ -z "$UsePropertiesFileFromProject" || $UsePropertiesFileFromProject == fal
44
then
55
echo "sonar.projectKey=$SonarqubeProjectKey" > sonar-project.properties
66
fi
7+
if [[ -z "$SonarContainerImage" ]]
8+
then
9+
SonarContainerImage="sonarsource/sonar-scanner-cli"
10+
fi
711
docker run \\
812
--rm \\
913
-e SONAR_HOST_URL=$SonarqubeEndpoint \\
@@ -64,6 +68,11 @@ UPDATE plugin_pipeline_script SET script=E'#!/bin/sh
6468
# Define sonarqube scan function
6569
SonarqubeScanFunction() {
6670
echo -e "\n********** Starting the scanning ************"
71+
if [[ -z "$SonarContainerImage" ]]
72+
then
73+
SonarContainerImage="sonarsource/sonar-scanner-cli"
74+
fi
75+
6776
docker run --rm -e SONAR_HOST_URL=$SonarqubeEndpoint -e SONAR_LOGIN=$SonarqubeApiKey -v "/$PWD:/usr/src" $SonarContainerImage
6877
SonarScanStatusCode=$?
6978
echo -e "\nStatus code of sonarqube scanning command : $SonarScanStatusCode"

0 commit comments

Comments
 (0)