Neue Pipeline-Jenkins-File hinzugefügt
This commit is contained in:
@@ -1,52 +1,25 @@
|
||||
pipeline
|
||||
{
|
||||
agent
|
||||
{
|
||||
node
|
||||
{
|
||||
pipeline {
|
||||
agent {
|
||||
node {
|
||||
label 'Jenkins_Homer'
|
||||
}
|
||||
|
||||
}
|
||||
stages
|
||||
{
|
||||
stage('Build, Test, Analyze')
|
||||
{
|
||||
environment
|
||||
{
|
||||
dotnet ="C:\\Program Files\\dotnet\\"
|
||||
scannerHome = "C:\\home\\jenkins\\tools\\hudson.plugins.sonar.MsBuildSQRunnerInstallation\\C_sonar-runner"
|
||||
token = '5f6fffb1bd335a10f8da70b77701bb73d6cd15cf'
|
||||
project = 'wolwin_nightly'
|
||||
|
||||
}
|
||||
steps
|
||||
{
|
||||
cleanWs()
|
||||
checkout scm
|
||||
bat "dotnet restore WOLWin\\WOLWin.sln"
|
||||
bat "${scannerHome}\\SonarScanner.MSBuild.exe begin /k:${project} /d:sonar.login=${token} /d:sonar.verbose=true /d:sonar.cs.opencover.reportsPaths=${WORKSPACE}\\coverage.xml"
|
||||
bat "\"${tool 'MSBuild17'}\" ${WORKSPACE}\\WOLWin.sln /t:Restore /t:Rebuild /p:Configuration=Debug"
|
||||
bat "${scannerHome}\\SonarScanner.MSBuild.exe end /d:sonar.login=${token}"
|
||||
}
|
||||
}
|
||||
stage('Coverage')
|
||||
{
|
||||
environment
|
||||
{
|
||||
reportGen = "C:\\Nuget-Packages\\reportgenerator\\5.1.6\\tools\\net6.0\\ReportGenerator.exe"
|
||||
}
|
||||
steps
|
||||
{
|
||||
bat "${reportGen} -verbosity:Info -reports:${WORKSPACE}\\coverage.xml -targetdir:${WORKSPACE} -reporttypes:SonarQube;Cobertura;Html"
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
|
||||
step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: '**/Cobertura.xml', failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false])
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
bat "\"${tool 'MSBuild15'}\" ${WORKSPACE}\\WOLWin_nightly\\WOLWin\\WOLWin.csproj /t:Restore /t:Rebuild /p:Configuration=Release"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('SonarQube') {
|
||||
environment {
|
||||
scannerHome = tool 'sonar-scanner4.4'
|
||||
project = 'wolwin_nightly'
|
||||
}
|
||||
steps {
|
||||
withSonarQubeEnv('SonarQube_Homer') {
|
||||
bat "${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=${project}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user