From 130bad7f200ac28c036507beb47c7dc5b518bb20 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Sun, 27 Feb 2022 17:38:43 -0500 Subject: [PATCH] Experiment with linking an FDB sidecar container --- build-aux/Jenkinsfile.pr | 109 ++++++++++++++++++++------------------- 1 file changed, 57 insertions(+), 52 deletions(-) diff --git a/build-aux/Jenkinsfile.pr b/build-aux/Jenkinsfile.pr index be352d110ef..031a0c2d8e6 100644 --- a/build-aux/Jenkinsfile.pr +++ b/build-aux/Jenkinsfile.pr @@ -13,6 +13,56 @@ // License for the specific language governing permissions and limitations under // the License. +meta = [ + '21': [], + '22': [], + '23': [], + '24': [] +] + +def generateStage(ERLANG_VERSION) { + return { + stage(ERLANG_VERSION) { + node('docker') { + docker.image('foundation/foundationdb:6.3.23').withRun() { c -> + docker.image("${DOCKER_IMAGE_BASE}-${ERLANG_VERSION}").inside("${DOCKER_ARGS} --link ${c.id}:fdb") { + timeout(time: 90, unit: "MINUTES") { + stage("Erlang ${ERLANG_VERSION}") { + try { + echo "Building CouchDB PR using Erlang ${ERLANG_VERSION} and SpiderMonkey ${SM_VSN}" + sh( script: "rm -rf build-${ERLANG_VERSION} apache-couchdb-*", label: 'Clean out workspace' ) + unstash 'release-tarball' + sh( script: "mkdir -p ${COUCHDB_IO_LOG_DIR} build-${ERLANG_VERSION}" ) + sh( script: "tar -xf apache-couchdb-*.tar.gz -C build-${ERLANG_VERSION} --strip-components=1", label: 'Unpack release' ) + dir( "build-${ERLANG_VERSION}" ) { + sh( script: './configure --skip-deps', label: 'Configure CouchDB build system' ) + sh( script: 'make', label: 'Build CouchDB' ) + sh( script: 'make eunit', label: 'EUnit test suite' ) + sh( script: 'make elixir-suite', label: 'ExUnit unit test suite' ) + sh( script: 'make exunit', label: 'ExUnit integration test suite' ) + sh( script: 'make mango-test', label: 'Python-based Mango query test suite' ) + } + } + catch (err) { + dir( "build-${ERLANG_VERSION}" ) { + sh 'ls -l' + sh 'make build-report' + } + error("Build step failed with error: ${err.getMessage()}") + } + finally { + junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml' + sh 'rm -rf ${WORKSPACE}/* ${COUCHDB_IO_LOG_DIR}' + } + } + } + } + } + } + } + } +} + pipeline { // no top-level agent; agents must be declared for each stage @@ -85,60 +135,15 @@ pipeline { } // stage Build Release Tarball stage('Make Check') { - matrix { - axes { - axis { - name 'ERLANG_VERSION' - values '21', '22', '23', '24' + steps { + script { + // Including failFast: true in map fails the build immediately if any parallel step fails + parallelStagesMap = meta.collectEntries( [failFast: false] ) { key, values -> + ["${key}": generateStage(key)] } + parallel parallelStagesMap } - - stages { - stage('Build and Test') { - agent { - docker { - image "${DOCKER_IMAGE_BASE}-${ERLANG_VERSION}" - label 'docker' - args "${DOCKER_ARGS}" - } - } - options { - skipDefaultCheckout() - } - steps { - timeout(time: 90, unit: "MINUTES") { - echo "Building CouchDB PR using Erlang ${ERLANG_VERSION} and SpiderMonkey ${SM_VSN}" - sh( script: "rm -rf build-${ERLANG_VERSION} apache-couchdb-*", label: 'Clean out workspace' ) - unstash 'release-tarball' - sh( script: "mkdir -p ${COUCHDB_IO_LOG_DIR} build-${ERLANG_VERSION}" ) - sh( script: "tar -xf apache-couchdb-*.tar.gz -C build-${ERLANG_VERSION} --strip-components=1", label: 'Unpack release' ) - dir( "build-${ERLANG_VERSION}" ) { - sh( script: './configure --skip-deps', label: 'Configure CouchDB build system' ) - sh( script: 'make', label: 'Build CouchDB' ) - sh( script: 'make eunit', label: 'EUnit test suite' ) - sh( script: 'make elixir-suite', label: 'ExUnit unit test suite' ) - sh( script: 'make exunit', label: 'ExUnit integration test suite' ) - sh( script: 'make mango-test', label: 'Python-based Mango query test suite' ) - } - } - } - post { - always { - junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml' - } - failure { - dir( "build-${ERLANG_VERSION}" ) { - sh 'ls -l' - sh 'make build-report' - } - } - cleanup { - sh 'rm -rf ${WORKSPACE}/* ${COUCHDB_IO_LOG_DIR}' - } - } - } // stage "Build and Test" - } // stages - } // matrix + } } // stage "Make Check" } // stages } // pipeline