Heya all!
We’re running Community Build, v25.9.0.112764, Standard Experience, and are having some weirdness with the deployment of it via an automated route.
We deploy sonarqube via Octopus Deploy, as an zip file. This is then unpacked and deployed in stages by our pipeline.
The issue we’ve been hitting is that, when it comes to creating the Sonar service itself, there’s a BAT file which is resistant to any automated attempts to run. It will appear to succeed when run from Octo (where it is called by a powershell script), but nothing happens. Triggering the same BAT file manually does work, and running the powershell function (shown below) also does work - it’s literally only running it from octo that fails!
For reference, the powershell function that calls the CMD file looks like this (the variables are replaced at the point of being run):
Reset-Path
Set-SonarService -SONARQUBE_HOME "$SONARQUBE_HOME" -SonarVersion "$SonarVersion"
The function itself is as follows:
#Creates SonarQube Service
Function Set-SonarService {
param([string]$SONARQUBE_HOME,
[string]$SonarVersion)
try {
Write-Output "Creating SonarQube Service..."
Start-Process -FilePath "$SONARQUBE_HOME\SonarQube $SonarVersion\bin\windows-x86-64\SonarService.bat" -ArgumentList "install"
Write-Output "SonarQube Service Created."
}
catch {
Throw "SonarQube Service Not Installed."
}
}
I’m really hoping someone else out there has had this issue (particularly relating to automated deployment of Sonar) and can advise on what the best route forward is, as we’d love to be able to have an automated DR process to rebuild sonar without having to do this bit manually!
TIA all ![]()