-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·30 lines (25 loc) · 998 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
source functions.sh
source log-functions.sh
source str-functions.sh
source file-functions.sh
source aws-functions.sh
logInfoMessage "I'll scan the code available at [$WORKSPACE] and have mounted at [$CODEBASE_DIR]"
sleep $SLEEP_DURATION
cd $WORKSPACE
logInfoMessage "I've recieved below arguments [$@]"
sonar-scanner -Dsonar.login=$SONAR_TOKEN -Dsonar.host.url=$SONAR_URL -Dsonar.projectKey=$CODEBASE_DIR -Dsonar.java.binaries=$CODEBASE_DIR "$SONAR_ARGS"
if [ $? -eq 0 ]
then
logInfoMessage "Congratulations sonar scan succeeded!!!"
generateOutput mvn_execute true "Congratulations sonar scan succeeded!!!"
elif [ $VALIDATION_FAILURE_ACTION == "FAILURE" ]
then
logErrorMessage "Please check sonar scan failed!!!"
generateOutput mvn_execute false "Please check sonar scan failed!!!!!"
echo "build unsucessfull"
exit 1
else
logWarningMessage "Please check sonar scan failed!!!"
generateOutput mvn_execute true "Please check sonar scan failed!!!!!"
fi