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
Copy file name to clipboardExpand all lines: it/audit.sh
+13-7Lines changed: 13 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ echo $SONAR_TOKEN
29
29
# Audit code
30
30
echo"Launching scanner..."
31
31
cd /usr/src/myapp/it
32
-
sonar-scanner -X -Dsonar.qualitygate.wait 2>&1| tee /tmp/scanner.log
32
+
sonar-scanner -Dsonar.log.level=DEBUG -Dsonar.verbose=true -Dsonar.qualitygate.wait 2>&1| tee /tmp/scanner.log
33
33
34
34
if [ $?-ne 0 ]
35
35
then
@@ -64,26 +64,32 @@ if r.status_code != 200:
64
64
65
65
data = r.json()
66
66
67
-
if data['total'] != 100:
68
-
print('Wrong total number of issues: ' + str(data['total']), file=sys.stderr)
69
-
sys.exit(1)
70
-
71
67
issues = 0
72
68
if 'f77-rules' in data['issues'][0]['rule'] and data['issues'][0]['line'] == 1:
73
69
issues += 1
74
70
71
+
if data['total'] != 100:
72
+
print('Wrong total number of issues: ' + str(data['total']), file=sys.stderr)
73
+
sys.exit(1)
74
+
else:
75
+
print('Validation Fortran 77 OK. Issues found: ' + str(data['total']), file=sys.stdout)
76
+
75
77
r = requests.get('http://sonarqube:9000/api/issues/search?componentKeys=$SONAR_PROJECT_KEY:src/clanhb.f90&statuses=OPEN', auth=('$SONAR_ADMIN_LOGIN', '$SONAR_ADMIN_PWD'))
76
78
if r.status_code != 200:
77
79
print('Invalid server response: ' + str(r.status_code), file=sys.stderr)
78
80
sys.exit(1)
79
81
80
82
data = r.json()
81
83
84
+
85
+
if 'f90-rules' in data['issues'][0]['rule'] and data['issues'][0]['line'] == 1:
86
+
issues += 1
87
+
82
88
if data['total'] != 197:
83
89
print('Wrong total number of issues: ' + str(data['total']), file=sys.stderr)
84
90
sys.exit(1)
85
-
if 'f90-rules' in data['issues'][0]['rule'] and data['issues'][0]['line'] == 1:
86
-
issues += 1
91
+
else:
92
+
print('Validation Fortran 90 OK. Issues found: ' + str(data['total']), file=sys.stdout)
0 commit comments