Hi All,
I am running an SSIS package deployed in integration services using Jenkins. But Jenkins job always shows success even package execution is failed.
Below is code:
env.DTexecEXE = "C:\\Program Files\\Microsoft SQL Server\\150\\DTS\\Binn\\dtexec.exe"
withCredentials([usernamePassword(credentialsId: 'ABCD',
usernameVariable: 'ABCD', passwordVariable: 'XYZ')]) {
timeout(time: 1, unit: 'DAYS') {
node("master") {
stage('DTSX Deploy') {
timeout(time: 8, unit: 'HOURS') {
bat(script: """
SETLOCAL ENABLEDELAYEDEXPANSION
echo Deploying Package
"${env.DTexecEXE}" /SERVER "1234" /ISSERVER "\\SSISDB\\Mi\\Packages\\TestPackage.dtsx" /Envreference 2 /CHECKPOINTING ON /REPORTING EW
""", returnStatus: true)
def errorLevel = bat(returnStatus: true, script: 'echo %ERRORLEVEL%').toInteger()
if (errorLevel == 0) {
println("SSIS package executed successfully")
} else {
println("SSIS package failed with error level: ${errorLevel}")
error("SSIS package failed")
}
}
}
}
}
}
My Analysis: Dtexec utility always returning success to Jenkins.
Q. What attribute we can use with /ISServer so that correct dtexec utility status is captured in Jenkins script?