Pipeline Job For Sonar Qube

Hi. In my case, I need to change gitlab-ci.yml to use Sonar Qube hosted Azure Ubuntu Vm in Docker Container. The old file is configured for Sonar Scanner hosted on a Windows machine. How can I change it for Sonar hosted on Ubuntu
variables:
SONAR_USER_HOME: “${CI_PROJECT_DIR}/.sonar” # Defines the location of the analysis task cache
GIT_DEPTH: “0” # Tells git to fetch all the branches of the project, required by the analysis task

stages:

  • build
  • test

before_script:

  • Set-Variable -Name “time” -Value (Get-Date -Format “%H:%m”)
  • echo ${time}
  • echo “started by ${GITLAB_USER_NAME}”

build:
stage: build
only:
- branches
script:
- echo “running scripts in the build job”
- choco feature enable -n=allowGlobalConfirmation
- choco install netfx-4.6.2-devpack
- choco install dotnetcore-sdk
- nuget restore -ConfigFile .\nuget.config
- msbuild “.\Process\Process.csproj” /p:DeployOnBuild=true /p:PublishProfile=“Local Publish” /p:WarningLevel=0
- dotnet build “.\Process.Tests\Process.Tests.csproj” --configuration Release
artifacts:
paths:
- Publish
- .\Process.Tests\bin\Release\netcoreapp3.1**
- .\Process
expire_in: 1 day
after_script:
- Remove-Item -Recurse -Force .\packages\

sonarcloud-check:
image:
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""]
cache:
key: “${CI_JOB_NAME}”
paths:
- .sonar/cache
dependencies:
- build
script:
- choco install sonarqube-scanner.portable
- SonarScanner.MSBuild.exe begin /k:“xbrlCompliant” /d:sonar.host.url=“http://localhost:9000” /d:sonar.login=“8f6658e7684de225a4f45c7cf3466d462a95c1c7”
- nuget restore -ConfigFile .\nuget.config
- MsBuild.exe ./Process /t:Rebuild
- SonarScanner.MSBuild.exe end /d:sonar.login=“8f6658e7684de225a4f45c7cf3466d462a95c1c7”
only:
- merge_requests
- master
- develop
- GitLabQualityTool