Neue Pipeline-Jenkins-File hinzugefügt
This commit is contained in:
@@ -1,52 +1,25 @@
|
|||||||
pipeline
|
pipeline {
|
||||||
{
|
agent {
|
||||||
agent
|
node {
|
||||||
{
|
|
||||||
node
|
|
||||||
{
|
|
||||||
label 'Jenkins_Homer'
|
label 'Jenkins_Homer'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
stages {
|
||||||
stages
|
stage('Build') {
|
||||||
{
|
steps {
|
||||||
stage('Build, Test, Analyze')
|
bat "\"${tool 'MSBuild15'}\" ${WORKSPACE}\\WOLWin_nightly\\WOLWin\\WOLWin.csproj /t:Restore /t:Rebuild /p:Configuration=Release"
|
||||||
{
|
}
|
||||||
environment
|
}
|
||||||
{
|
}
|
||||||
dotnet ="C:\\Program Files\\dotnet\\"
|
stage('SonarQube') {
|
||||||
scannerHome = "C:\\home\\jenkins\\tools\\hudson.plugins.sonar.MsBuildSQRunnerInstallation\\C_sonar-runner"
|
environment {
|
||||||
token = '5f6fffb1bd335a10f8da70b77701bb73d6cd15cf'
|
scannerHome = tool 'sonar-scanner4.4'
|
||||||
project = 'wolwin_nightly'
|
project = 'wolwin_nightly'
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
withSonarQubeEnv('SonarQube_Homer') {
|
||||||
|
bat "${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=${project}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
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])
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user