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
- analyze
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 ".\ProcessFlowModuleDotNetV1\ProcessFlowModule.csproj" /p:DeployOnBuild=true /p:PublishProfile="Local Publish" /p:WarningLevel=0
- dotnet build ".\ProcessFlowModuleDotNetV1.Tests\ProcessFlowModule.Tests.csproj" --configuration Release
artifacts:
paths:
- Publish
- .\ProcessFlowModule.Tests\bin\Release\netcoreapp3.1\**
- .\ProcessFlowModule
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:
- SonarScanner.MSBuild.exe begin /k:"project_key" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="jjhyd8b6500d75a8af6f7c3a3726a2b8782a39a439a7"
- nuget restore -ConfigFile .\nuget.config
- MsBuild.exe ./ProcessFlowModule /t:Rebuild
- SonarScanner.MSBuild.exe end /d:sonar.login="jjhyd8b6500d75a8af6f7c3a3726a2b8782a39a439a7"
only:
- branches
Here I try with default script:
sonarcloud-check:
stage: test
image:
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""]
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
- sonar-scanner
Latest posts by Rajesh Kumar (see all)
- Best AI tools for Software Engineers - November 4, 2024
- Installing Jupyter: Get up and running on your computer - November 2, 2024
- An Introduction of SymOps by SymOps.com - October 30, 2024