02-01-2021 08:30 AM
Hi,
I have setup a Jenkins with GITlab Continues Integration setup Based on the NI Knowledge Article:
LabVIEW Continuous Integration With Jenkins/GitHub - National Instruments (ni.com)
The Project itself is working correctly.
If I edit a VI in a way that it is broken. I get the error description in the „Consele Output“ but in the „Stage View“ I didn’t see that the build is failed.
lvPipeline.groovy:
stage('Build project') {
try {
timeout(time: 60, unit: 'MINUTES') {
lvBuild(lvProjectPath, "My Computer", lvBuildSpecName, lvVersion, lvBitness)
}
} catch (err) {
stageResult= 'NOT_BUILT'
currentBuild.result = 'NOT_BUILT'
echo "Project Build Failed: ${err}"
}
}
I try different variants without any result. My guess catch(err) never give a result.
Perhaps somebody has a solution for this Problem.
Thank You
Solved! Go to Solution.
02-02-2021 03:46 AM
#!/usr/bin/env groovy
import java.*
import java.lang.*
import hudson.*
import hudson.model.*
import jenkins.model.Jenkins
stage('\u277A CheckLog Build') {
if (manager.logContains('.*ExecuteBuildSpec operation succeeded.*')) {
stageResult= 'SUCCESS'
currentBuild.result = 'SUCCESS'
echo "\u2705 Project Build PASS"
}else{
echo "\u274C Project Build Failed:"
error("Build failed because of this and that...")
stageResult= 'NOT_BUILT'
currentBuild.result = 'NOT_BUILT'
return PipelineResult.ABORTED
}
}