11#!groovy
22import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException
33
4+ def init_os_distro() {
5+ env.OS_DISTRO = sh(label: 'Assign env.OS_DISTRO based on OS env', script: '''#!/bin/bash -le
6+ echo ${OS_DISTRO}''', returnStdout: true).trim()
7+ }
8+
49def initializeEnvironment() {
510 env.DRIVER_DISPLAY_NAME = 'Cassandra C/C++ Driver'
611 env.DRIVER_TYPE = 'CASS'
@@ -545,6 +550,7 @@ pipeline {
545550 post {
546551 success {
547552 // Allow empty results for 'osx/high-sierra' which doesn't produce packages
553+ init_os_distro()
548554 archiveArtifacts artifacts: "${env.OS_DISTRO}/**/libuv*", allowEmptyArchive: true
549555 }
550556 }
@@ -555,10 +561,12 @@ pipeline {
555561 }
556562 post {
557563 success {
564+ init_os_distro()
558565 archiveArtifacts artifacts: "${env.OS_DISTRO}/**/cassandra-*-tests"
559566 archiveArtifacts artifacts: "${env.OS_DISTRO}/**/dse-*-tests", allowEmptyArchive: true
560567 }
561568 failure {
569+ init_os_distro()
562570 archiveArtifacts artifacts: "${env.OS_DISTRO}/**/CMakeOutput.log"
563571 archiveArtifacts artifacts: "${env.OS_DISTRO}/**/CMakeError.log"
564572 }
@@ -590,6 +598,7 @@ pipeline {
590598 }
591599 post {
592600 success {
601+ init_os_distro()
593602 archiveArtifacts artifacts: "${env.OS_DISTRO}/**/*-cpp-driver*"
594603 }
595604 }
@@ -748,6 +757,7 @@ pipeline {
748757 }
749758 post {
750759 failure {
760+ init_os_distro()
751761 archiveArtifacts artifacts: "${env.OS_DISTRO}/**/CMakeOutput.log"
752762 archiveArtifacts artifacts: "${env.OS_DISTRO}/**/CMakeError.log"
753763 }
@@ -764,6 +774,7 @@ pipeline {
764774 junit testResults: '*integration-tests-*-results.xml', allowEmptyResults: true
765775 }
766776 failure {
777+ init_os_distro()
767778 archiveArtifacts artifacts: "${env.OS_DISTRO}/**/*-integration-tests-driver-logs.tgz"
768779 }
769780 cleanup {
0 commit comments