diff --git a/Jenkinsfile b/Jenkinsfile index b6ada41b8..281958ec9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -91,14 +91,20 @@ def parallelStages = [failFast: false] } } } else { - stage('Build and Test') { - // ci.jenkins.io builds (e.g. no publication) + // ci.jenkins.io builds (e.g. no publication) + stage('Build') { if (isUnix()) { sh './build.sh' + } else { + powershell '& ./build.ps1 build' + archiveArtifacts artifacts: 'build-windows_*.yaml', allowEmptyArchive: true + } + } + stage('Test') { + if (isUnix()) { sh './build.sh test' } else { powershell '& ./build.ps1 test' - archiveArtifacts artifacts: 'build-windows_*.yaml', allowEmptyArchive: true } junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/**/junit-results*.xml') } diff --git a/build.ps1 b/build.ps1 index e6c4c8ccf..e32a2098f 100644 --- a/build.ps1 +++ b/build.ps1 @@ -189,15 +189,17 @@ foreach($agentType in $AgentTypes) { Write-Host '= PREPARE: List of images and tags to be processed:' Invoke-Expression "$baseDockerCmd config" - Write-Host '= BUILD: Building all images...' - switch ($DryRun) { - $true { Write-Host "(dry-run) $baseDockerBuildCmd" } - $false { Invoke-Expression $baseDockerBuildCmd } - } - Write-Host '= BUILD: Finished building all images.' + if ($target -eq 'build') { + Write-Host '= BUILD: Building all images...' + switch ($DryRun) { + $true { Write-Host "(dry-run) $baseDockerBuildCmd" } + $false { Invoke-Expression $baseDockerBuildCmd } + } + Write-Host '= BUILD: Finished building all images.' - if ($lastExitCode -ne 0) { - exit $lastExitCode + if ($lastExitCode -ne 0) { + exit $lastExitCode + } } if ($target -eq 'test') {