Index: build/unittest.sh =================================================================== diff -u -rfed1fbaa1a2ff0c0d52bd491e2ed2bc9383f8a41 -rdaccaf21e20cdf95fcd9c95678c652f1d4cff619 --- build/unittest.sh (.../unittest.sh) (revision fed1fbaa1a2ff0c0d52bd491e2ed2bc9383f8a41) +++ build/unittest.sh (.../unittest.sh) (revision daccaf21e20cdf95fcd9c95678c652f1d4cff619) @@ -3,7 +3,6 @@ # Local example $./run.unittest.sh :0 5.12.5 /media/sf_VMSHARE PYCOMMON="" # use anything other that "" to use pycommon as SquishQt API lib source # TODO pycommon is not needed right? -reportDir="" function readTestsList() { TESTS_LIST=() @@ -84,7 +83,6 @@ setBuildVariables ${buildSpecs[@]} REPORT_DIR=$(getRemoteCopyAddress "DEN_UI" ${buildSpecs[$PROJECT_CHECKOUT_INDEX]}) - reportDir=$REPORT_DIR STATUS_REPORT=$(createStatusReport "application" $REPORT_DIR $isBuildLocal) getCommitHashes $STATUS_REPORT ${buildSpecs[$PROJECT_NAME_INDEX]} ${buildSpecs[$PROJECT_CHECKOUT_INDEX]} \ ${buildSpecs[$COMMON_CHECKOUT_INDEX]} "" ${buildSpecs[$PROJECT_CHECKOUT_INDEX]} @@ -437,6 +435,8 @@ local sonarFolder="SonarQube" local buildWrapperJson="Build_Wrapper_JSON" local sonarLogs="SonarQubeLogs.log" + local sonarRunProject="UI-SonarRun" + local inlineScriptForRepor="sonarReportGeneration.sh" echo " ------------------------------ Running SonarQube test" echo "Current squish location $(pwd)" mkdir "$sonarFolder" @@ -447,6 +447,9 @@ cd application || return echo "New squish location $(pwd)" touch "$sonarLogs" + touch "$sonarReportGeneration" + chmod +x "$sonarReportGeneration" + ./alarmMapping.sh "/opt/Qt5.15.10/5.15.10/gcc_64"/bin/qmake @@ -456,20 +459,26 @@ cp "$currentDir"/"$sonarFolder"/"$buildWrapperJson"/build-wrapper-dump.json "$(pwd)" - /opt/sonar-scanner-4.8.0.2856-linux/bin/sonar-scanner -Dsonar.projectKey=UI-SonarRun -Dsonar.sources=. \ + /opt/sonar-scanner-4.8.0.2856-linux/bin/sonar-scanner -Dsonar.projectKey="$sonarRunProject" -Dsonar.sources=. \ -Dsonar.cfamily.build-wrapper-output=. \ -Dsonar.cfamily.threads=4 -Dsonar.host.url=http://192.168.10.41:9000 \ -Dsonar.login=admin -Dsonar.password=WonderFirst23@ | tee -a "$sonarLogs" cp -r "$sonarLogs" "$REPORT_DIR" - sshpass -p "WonderFirst23@" ssh dnavaei@192.168.10.41 echo "EOF - cd $(pwd)/Downloads/SonarQube_Reports - latestRunDate=$(date '+%Y-%m-%d') - docxFile=$(find . -name "*.docx" | grep "2024-01-11") - echo Here are the files: $latestRunDate, $docxFile - EOF" + echo 'cd /home/dnavaei/Downloads/SonarQube_Reports' >> "$sonarReportGeneration" + echo 'latestRunDate=$(date +%Y-%m-%d)' >> "$sonarReportGeneration" + echo 'runReport=$(java -jar sonar-cnes-report-4.2.0.jar -p $sonarRunProject -t \ + aa04ef5851c9cd5bcaaa305e7173714a2739b3f0)' >> "$sonarReportGeneration" + echo 'docxFile=$(find $(pwd) -name "*.docx" | grep "$latestRunDate")' >> "$sonarReportGeneration" + echo 'echo $docxFile' >> "$sonarReportGeneration" + sshpass -p "WonderFirst23@" scp "$sonarReportGeneration" dnavaei@192.168.10.41:~/ + + reportAddress=$(sshpass -p "WonderFirst23@" ssh -t dnavaei@192.168.10.41 ./tempScript.sh) + + echo "Here is the file I got: $reportAddress" + cd "$currentDir" || return }