cancel non-started finalization testnets on cancel (#4334)
When cancelling the `minimal` CI finalization testnet on Jenkins, the internal Jenkins cancellation exception is being caught by `catchError` and the `mainnet` CI finalization testnet will still run. Replacing the logic with `try` / `finally` instead, and moving the `archiveArtifacts` step to the post-build (to run that even on cancellation / failure).
This commit is contained in:
parent
95e93a3215
commit
0e32ed0cc0
|
@ -77,23 +77,26 @@ pipeline {
|
|||
stage('Finalizations') {
|
||||
stages { /* parallel builds of minimal / mainnet not yet supported */
|
||||
stage('minimal') {
|
||||
steps { script { timeout(26) {
|
||||
launchLocalTestnet('minimal')
|
||||
} } }
|
||||
steps { timeout(26) {
|
||||
sh 'make local-testnet-minimal'
|
||||
} }
|
||||
post { always {
|
||||
sh 'tar cjf local-testnet-minimal.tar.gz local-testnet-minimal/*.txt'
|
||||
} }
|
||||
}
|
||||
|
||||
stage('mainnet') {
|
||||
steps { script { timeout(62) {
|
||||
launchLocalTestnet('mainnet')
|
||||
} } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Upload') {
|
||||
steps { timeout(5) {
|
||||
archiveArtifacts('*.tar.gz')
|
||||
steps { timeout(62) {
|
||||
sh 'make local-testnet-mainnet'
|
||||
} }
|
||||
post { always {
|
||||
sh 'tar cjf local-testnet-mainnet.tar.gz local-testnet-mainnet/*.txt'
|
||||
} }
|
||||
}
|
||||
}
|
||||
post { always { timeout(5) {
|
||||
archiveArtifacts(artifacts: '*.tar.gz', allowEmptyArchive: true)
|
||||
} } }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,19 +110,6 @@ pipeline {
|
|||
}
|
||||
}
|
||||
|
||||
def launchLocalTestnet(String name) {
|
||||
/* We want to mark job as failed, but save the results. */
|
||||
catchError(
|
||||
message: "Local ${name} testnet finalization failure!",
|
||||
buildResult: 'FAILURE',
|
||||
stageResult: 'FAILURE'
|
||||
) {
|
||||
sh "make local-testnet-${name}"
|
||||
}
|
||||
/* Archive test results regardless of outcome. */
|
||||
sh "tar cjf local-testnet-${name}.tar.gz local-testnet-${name}/*.txt"
|
||||
}
|
||||
|
||||
def isMainBranch() {
|
||||
return ['stable', 'testing', 'unstable'].contains(env.BRANCH_NAME)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue