cnescatlab / sonar-cnes-report

Generates analysis reports from SonarQube web API.
GNU General Public License v3.0
425 stars 150 forks source link

Generating Report via Scripting #359

Closed hexploder closed 3 weeks ago

hexploder commented 1 year ago

I run the command

java -jar sonar-cnes-report-4.1.2.jar -t "xxxxx" -p project_name in the terminal and everything goes well

I try to run this command through a bash script that basically run a for of a list of project_names and technically the script finishes but no report is being generated.

I thought that maybe because while running a script it runs the java -jar multiple times one execution step the other and fails so I made a logic that saves the PID of the java running the sonar-cnes-report. jar and with a while I check when the PID is no longer there basically while [ -n $PID] with this I can see that each execution of the jar is starting after the one before finishes, yet no report is being generated, I run the java command in a multiple combination of nohup, as background with &, with a > /dev/null with a 2>&1 I do not find a way of making the reports get generated.

I end up even creating a second script where I run the java command with nothing and then calling with nohup and background the script it self so the execution of the java command is detached of the first script nothing works.

I suspect that the java command runs as a process to connect to sonar (that is running locally) and then a second process actually generates the report so am I not waiting for that? yet I do a sleep 10 after the PID dissapear and nothing.

Is this a behavior of java or the sonar-cnes-report not being able to work as a background script or to work being executed from a script or maybe I'm having some dumb thing with users and permissions?.

In the nohup.out I am not getting the last line saying that the report was SUCCEDED to be generated, but the lines before are the same as for the stdout of the command in the terminal executed directly.

Please complete the following information.

Topin2001 commented 1 month ago

Hi, sorry for the late answer, do you still encounter this issue ? What's your actual SQ version and plugin version ? I'll try to reproduce it, but I'm not sure this is part of our scope. Please keep me updated