From 0986b845aa250e1e68ea4997c0fc172facfba0c6 Mon Sep 17 00:00:00 2001 From: dev-mkoebis Date: Wed, 17 Jun 2026 14:54:12 +0200 Subject: [PATCH] =?UTF-8?q?Neue=20Pipeline-Jenkins-File=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WOLWin/config/Jenkinsfile.txt | 73 +++++++++++------------------------ 1 file changed, 23 insertions(+), 50 deletions(-) diff --git a/WOLWin/config/Jenkinsfile.txt b/WOLWin/config/Jenkinsfile.txt index 266e6de..4f00593 100644 --- a/WOLWin/config/Jenkinsfile.txt +++ b/WOLWin/config/Jenkinsfile.txt @@ -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}" + } + } + } + } \ No newline at end of file