diff options
author | Adam Kocoloski <kocolosk@apache.org> | 2022-01-15 12:50:04 -0500 |
---|---|---|
committer | Adam Kocoloski <kocolosk@apache.org> | 2022-01-15 12:50:04 -0500 |
commit | e0ca5f7f9cb5109823b7540bbac691fd77413417 (patch) | |
tree | 9ecca515267207495e92a399c19ec4475ee29ac1 | |
parent | e97f0c7abb1ffb28d5b97bce7eea237f658f89a2 (diff) | |
download | couchdb-e0ca5f7f9cb5109823b7540bbac691fd77413417.tar.gz |
Combine all into one matrix
-rw-r--r-- | build-aux/Jenkinsfile.full | 210 |
1 files changed, 98 insertions, 112 deletions
diff --git a/build-aux/Jenkinsfile.full b/build-aux/Jenkinsfile.full index a1936446c..3d9458663 100644 --- a/build-aux/Jenkinsfile.full +++ b/build-aux/Jenkinsfile.full @@ -148,133 +148,122 @@ pipeline { timeout(time: 90, unit: "MINUTES") } - parallel { - - stage('FreeBSD') { - agent { - label 'freebsd' + matrix { + axes { + axis { + name 'platform' + values 'macos', 'freebsd', 'centos7', 'centos8', 'bionic', 'focal', 'stretch', 'buster', 'bullseye' } - steps { - // deleteDir is OK here because we're not inside of a Docker container! - deleteDir() - unstash 'tarball' - withEnv(['HOME='+pwd()]) { - sh ''' - mkdir -p $COUCHDB_IO_LOG_DIR - - # Build CouchDB from tarball & test - mkdir build - cd build - tar -xf $WORKSPACE/apache-couchdb-*.tar.gz - cd apache-couchdb-* - ./configure - gmake check || (build-aux/logfile-uploader.py && false) - - # No package build for FreeBSD at this time - ''' - } // withEnv - } // steps - post { - always { - junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml' - } - cleanup { - sh 'killall -9 beam.smp || true' - sh 'rm -rf ${WORKSPACE}/* ${COUCHDB_IO_LOG_DIR} || true' - } - } // post - } // stage FreeBSD + } - stage('macOS') { - agent { - label 'macos' - } - steps { - // deleteDir is OK here because we're not inside of a Docker container! - deleteDir() - unstash 'tarball' - withEnv(['HOME='+pwd()]) { - sh ''' - PATH=/usr/local/bin:$PATH - export PATH - mkdir -p $COUCHDB_IO_LOG_DIR - - # Build CouchDB from tarball & test - mkdir build - cd build - tar -xzf $WORKSPACE/apache-couchdb-*.tar.gz - cd apache-couchdb-* - ./configure --spidermonkey-version 60 - make check || (build-aux/logfile-uploader.py && false) - - # No package build for macOS at this time - ''' - } // withEnv - } // steps - post { - always { - junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml' + stages { + stage('Non-containerized Platform') { + when { + anyOf { + expression { env.platform == 'macos' } + expression { env.platform == 'freebsd' } + } } - cleanup { - sh 'killall -9 beam.smp || true' - sh 'rm -rf ${WORKSPACE}/* ${COUCHDB_IO_LOG_DIR} || true' + + agent { + label env.platform } - } // post - } // stage macOS - - stage('Linux') { - matrix { - axes { - axis { - name 'platform' - values 'centos7', 'centos8', 'bionic', 'focal', 'stretch', 'buster', 'bullseye' + + steps { + // deleteDir is OK here because we're not inside of a Docker container! + deleteDir() + unstash 'tarball' + withEnv(['HOME='+pwd()]) { + sh ''' + PATH=/usr/local/bin:$PATH + export PATH + mkdir -p $COUCHDB_IO_LOG_DIR + + # Build CouchDB from tarball & test + mkdir build + cd build + tar -xzf $WORKSPACE/apache-couchdb-*.tar.gz + cd apache-couchdb-* + ./configure --spidermonkey-version 60 + make check || (build-aux/logfile-uploader.py && false) + + # No package build for non-containerized platforms at this time + ''' + } // withEnv + } // steps + + post { + always { + junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml' } - } + cleanup { + sh 'killall -9 beam.smp || true' + sh 'rm -rf ${WORKSPACE}/* ${COUCHDB_IO_LOG_DIR} || true' + } + } // post + + } // non-containerized platform - stages { - agent { - docker { - image platform_images["${platform}"] - label 'docker' - args "${DOCKER_ARGS}" - registryUrl 'https://docker.io/' - registryCredentialsId 'dockerhub_creds' + stage('Containerized Platform') { + when { + not { + anyOf { + expression { env.platform == 'macos' } + expression { env.platform == 'freebsd' } } } - environment { - sm_ver = spidermonkey_version["${platform}"] + } + + agent { + docker { + image platform_images["${platform}"] + label 'docker' + args "${DOCKER_ARGS}" + registryUrl 'https://docker.io/' + registryCredentialsId 'dockerhub_creds' } - stage('Build from tarball & test') { - steps { - unstash 'tarball' - sh( script: build_and_test ) - } - post { - always { - junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml' - } - } + } + + environment { + sm_ver = spidermonkey_version["${platform}"] + } + + stage('Build from tarball & test') { + steps { + unstash 'tarball' + sh( script: build_and_test ) } - stage('Build CouchDB packages') { - steps { - unstash 'tarball' - sh( script: make_packages ) - sh( script: cleanup_and_save ) + post { + always { + junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml' } - post { - success { - archiveArtifacts artifacts: 'pkgs/**', fingerprint: true - } + } + } + + stage('Build CouchDB packages') { + steps { + unstash 'tarball' + sh( script: make_packages ) + sh( script: cleanup_and_save ) + } + post { + success { + archiveArtifacts artifacts: 'pkgs/**', fingerprint: true } } - } // stages + } + post { cleanup { sh 'rm -rf ${WORKSPACE}/*' } } // post - } // matrix - } // stage + } // containerized platform + } // stages + + } // matrix + + } // stage 'Test and Package' @@ -434,9 +423,6 @@ pipeline { } // stage */ - } // parallel - } // stage "Test and Package" - stage('Publish') { when { |