This is an automated email from the ASF dual-hosted git repository.
kocolosk pushed a commit to branch jenkins-dynamic-matrix
in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/jenkins-dynamic-matrix by this
push:
new 81435f8 Use try-catch-finally to recover post function
81435f8 is described below
commit 81435f8d558e5c9fda3abfafab3ff583038938a9
Author: Adam Kocoloski <[email protected]>
AuthorDate: Sun Jan 16 22:53:18 2022 -0500
Use try-catch-finally to recover post function
---
build-aux/Jenkinsfile.full | 96 ++++++++++++++++++++++++++++------------------
1 file changed, 59 insertions(+), 37 deletions(-)
diff --git a/build-aux/Jenkinsfile.full b/build-aux/Jenkinsfile.full
index 7a28ebb..93aef41 100644
--- a/build-aux/Jenkinsfile.full
+++ b/build-aux/Jenkinsfile.full
@@ -116,28 +116,39 @@ def generateNativeStage(platform) {
stage(meta[platform].name) {
node(platform) {
timeout(time: 90, unit: "MINUTES") {
- // deleteDir is OK here because we're not inside of a Docker
container!
- deleteDir()
- unstash 'tarball'
- withEnv([
- 'HOME='+pwd(),
- 'PATH+USRLOCAL=/usr/local/bin',
- 'MAKE='+meta[platform].gnu_make,
- 'PLATFORM='+platform
- ]) {
- sh( script: unpack, label: 'Unpack tarball' )
- dir( "${platform}/build/couchdb" ) {
- sh 'pwd'
- sh 'ls -l'
- sh "./configure --skip-deps --spidermonkey-version
${meta[platform].spidermonkey_vsn}"
- sh '$MAKE'
- sh '$MAKE eunit'
- sh '$MAKE elixir-suite'
- sh '$MAKE exunit'
- sh '$MAKE mango-test'
+ try {
+ // deleteDir is OK here because we're not inside of a Docker
container!
+ deleteDir()
+ unstash 'tarball'
+ withEnv([
+ 'HOME='+pwd(),
+ 'PATH+USRLOCAL=/usr/local/bin',
+ 'MAKE='+meta[platform].gnu_make,
+ 'PLATFORM='+platform
+ ]) {
+ sh( script: unpack, label: 'Unpack tarball' )
+ dir( "${platform}/build/couchdb" ) {
+ sh 'pwd'
+ sh 'ls -l'
+ sh "./configure --skip-deps --spidermonkey-version
${meta[platform].spidermonkey_vsn}"
+ sh '$MAKE'
+ sh '$MAKE eunit'
+ sh '$MAKE elixir-suite'
+ sh '$MAKE exunit'
+ sh '$MAKE mango-test'
+ }
}
}
-
+ catch (exc) {
+ dir( "${platform}/build/couchdb" ) {
+ sh 'make build-report'
+ }
+ }
+ finally {
+ junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml,
**/src/mango/nosetests.xml, **/test/javascript/junit.xml'
+ sh 'killall -9 beam.smp || true'
+ sh 'rm -rf ${WORKSPACE}/* ${COUCHDB_IO_LOG_DIR} || true'
+ }
// post {
// always {
// junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml,
**/src/mango/nosetests.xml, **/test/javascript/junit.xml'
@@ -162,32 +173,43 @@ def generateContainerStage(platform) {
return {
stage(meta[platform].name) {
node('docker') {
- timeout(time: 90, unit: "MINUTES") {
- docker.withRegistry('https://docker.io/', 'dockerhub_creds') {
- docker.image(meta[platform].image).inside("${DOCKER_ARGS}") {
+ docker.withRegistry('https://docker.io/', 'dockerhub_creds') {
+ docker.image(meta[platform].image).inside("${DOCKER_ARGS}") {
+ timeout(time: 90, unit: "MINUTES") {
withEnv(['PLATFORM='+platform]) {
- stage('Build from tarball & test') {
- sh( script: 'rm -rf apache-couchdb-*', label: 'Clean
workspace' )
- unstash 'tarball'
- sh( script: unpack, label: 'Unpack tarball' )
- dir( "${platform}/build/couchdb" ) {
- sh 'pwd'
- sh 'ls -l'
- sh "./configure --skip-deps --spidermonkey-version
${meta[platform].spidermonkey_vsn}"
- sh 'make'
- sh 'make eunit'
- sh 'make elixir-suite'
- sh 'make exunit'
- sh 'make mango-test'
+ stage("${meta[platform].name} - build & test") {
+ try {
+ sh( script: 'rm -rf apache-couchdb-*', label: 'Clean
workspace' )
+ unstash 'tarball'
+ sh( script: unpack, label: 'Unpack tarball' )
+ dir( "${platform}/build/couchdb" ) {
+ sh 'pwd'
+ sh 'ls -l'
+ sh "./configure --skip-deps --spidermonkey-version
${meta[platform].spidermonkey_vsn}"
+ sh 'make'
+ sh 'make eunit'
+ sh 'make elixir-suite'
+ sh 'make exunit'
+ sh 'make mango-test'
+ }
+ }
+ catch (exc) {
+ dir( "${platform}/build/couchdb" ) {
+ sh 'make build-report'
+ }
+ }
+ finally {
+ junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml,
**/src/mango/nosetests.xml, **/test/javascript/junit.xml'
}
}
- stage('Build CouchDB packages') {
+ stage("${meta[platform].name} - package") {
sh 'pwd'
sh 'ls -l'
unstash 'tarball'
sh( script: make_packages, label: 'Build packages' )
sh( script: cleanup_and_save, label: 'Stage package
artifacts for archival' )
+ archiveArtifacts artifacts: 'pkgs/**', fingerprint: true,
onlyIfSuccessful: true
}
}
}