You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2022/01/15 17:09:21 UTC

[couchdb] branch jenkins-bump-erlang-and-debian-versions updated: Experiment with DRY matrix build

This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a commit to branch jenkins-bump-erlang-and-debian-versions
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/jenkins-bump-erlang-and-debian-versions by this push:
     new e97f0c7  Experiment with DRY matrix build
e97f0c7 is described below

commit e97f0c7abb1ffb28d5b97bce7eea237f658f89a2
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Sat Jan 15 12:08:21 2022 -0500

    Experiment with DRY matrix build
---
 build-aux/Jenkinsfile.full | 405 ++++++++++++---------------------------------
 1 file changed, 104 insertions(+), 301 deletions(-)

diff --git a/build-aux/Jenkinsfile.full b/build-aux/Jenkinsfile.full
index a0e12d9..a193644 100644
--- a/build-aux/Jenkinsfile.full
+++ b/build-aux/Jenkinsfile.full
@@ -47,6 +47,26 @@ update_qemu = '''
 docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
 '''
 
+platform_images = [
+  'centos7': "apache/couchdbci-centos:7-erlang-${ERLANG_VERSION}",
+  'centos8': "apache/couchdbci-centos:8-erlang-${ERLANG_VERSION}",
+  'bionic': "apache/couchdbci-ubuntu:bionic-erlang-${ERLANG_VERSION}",
+  'focal': "apache/couchdbci-ubuntu:focal-erlang-${ERLANG_VERSION}",
+  'stretch': "apache/couchdbci-debian:stretch-erlang-${ERLANG_VERSION}",
+  'buster': "apache/couchdbci-debian:buster-erlang-${ERLANG_VERSION}",
+  'bullseye': "apache/couchdbci-debian:bullseye-erlang-${ERLANG_VERSION}"
+]
+
+spidermonkey_version = [
+  'centos7': '1.8.5',
+  'centos8': '60',
+  'bionic': '1.8.5',
+  'focal': '68',
+  'stretch': '1.8.5',
+  'buster': '60',
+  'bullseye': '78'
+]
+
 pipeline {
 
   // no top-level agent; agents must be declared for each stage
@@ -202,324 +222,107 @@ pipeline {
           } // post
         } // stage macOS
 
-        stage('CentOS 7') {
-          agent {
-            docker {
-              image "apache/couchdbci-centos:7-erlang-${ERLANG_VERSION}"
-              label 'docker'
-              args "${DOCKER_ARGS}"
-              registryUrl 'https://docker.io/'
-              registryCredentialsId 'dockerhub_creds'
-            }
-          }
-          environment {
-            platform = 'centos7'
-            sm_ver = '1.8.5'
-          }
-          stages {
-            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'
-                }
+        stage('Linux') {
+          matrix {
+            axes {
+              axis {
+                name 'platform'
+                values 'centos7', 'centos8', 'bionic', 'focal', 'stretch', 'buster', 'bullseye'
               }
             }
-            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
-        } // stage
 
-        stage('CentOS 8') {
-          agent {
-            docker {
-              image "apache/couchdbci-centos:8-erlang-${ERLANG_VERSION}"
-              label 'docker'
-              args "${DOCKER_ARGS}"
-              registryUrl 'https://docker.io/'
-              registryCredentialsId 'dockerhub_creds'
-            }
-          }
-          environment {
-            platform = 'centos8'
-            sm_ver = '60'
-          }
-          stages {
-            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'
+            stages {
+              agent {
+                docker {
+                  image platform_images["${platform}"]
+                  label 'docker'
+                  args "${DOCKER_ARGS}"
+                  registryUrl 'https://docker.io/'
+                  registryCredentialsId 'dockerhub_creds'
                 }
               }
-            }
-            stage('Build CouchDB packages') {
-              steps {
-                unstash 'tarball'
-                sh( script: make_packages )
-                sh( script: cleanup_and_save )
-              }
-              post {
-                success {
-                  archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
-                }
+              environment {
+                sm_ver = spidermonkey_version["${platform}"]
               }
-            }
-          } // stages
-          post {
-            cleanup {
-              sh 'rm -rf ${WORKSPACE}/*'
-            }
-          } // post
-        } // stage
-
-        stage('Ubuntu Bionic') {
-          agent {
-            docker {
-              image "apache/couchdbci-ubuntu:bionic-erlang-${ERLANG_VERSION}"
-              label 'docker'
-              args "${DOCKER_ARGS}"
-              registryUrl 'https://docker.io/'
-              registryCredentialsId 'dockerhub_creds'
-            }
-          }
-          environment {
-            platform = 'bionic'
-            sm_ver = '1.8.5'
-          }
-          stages {
-            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'
-                }
-              }
-            }
-            stage('Build CouchDB packages') {
-              steps {
-                sh( script: make_packages )
-                sh( script: cleanup_and_save )
-              }
-              post {
-                success {
-                  archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
+              stage('Build from tarball & test') {
+                steps {
+                  unstash 'tarball'
+                  sh( script: build_and_test )
                 }
-              }
-            }
-          } // stages
-          post {
-            cleanup {
-              sh 'rm -rf ${WORKSPACE}/*'
-            }
-          } // post
-        } // stage
-
-        stage('Ubuntu Focal') {
-          agent {
-            docker {
-              image "apache/couchdbci-ubuntu:focal-erlang-${ERLANG_VERSION}"
-              label 'docker'
-              args "${DOCKER_ARGS}"
-              registryUrl 'https://docker.io/'
-              registryCredentialsId 'dockerhub_creds'
-            }
-          }
-          environment {
-            platform = 'focal'
-            sm_ver = '68'
-          }
-          stages {
-            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'
+                post {
+                  always {
+                    junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml'
+                  }
                 }
               }
-            }
-            stage('Build CouchDB packages') {
-              steps {
-                sh( script: make_packages )
-                sh( script: cleanup_and_save )
-              }
-              post {
-                success {
-                  archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
+              stage('Build CouchDB packages') {
+                steps {
+                  unstash 'tarball'
+                  sh( script: make_packages )
+                  sh( script: cleanup_and_save )
                 }
-              }
-            }
-          } // stages
-          post {
-            cleanup {
-              sh 'rm -rf ${WORKSPACE}/*'
-            }
-          } // post
-        } // stage
-
-        stage('Debian Stretch') {
-          agent {
-            docker {
-              image "apache/couchdbci-debian:stretch-erlang-${ERLANG_VERSION}"
-              label 'docker'
-              args "${DOCKER_ARGS}"
-              registryUrl 'https://docker.io/'
-              registryCredentialsId 'dockerhub_creds'
-            }
-          }
-          environment {
-            platform = 'stretch'
-            sm_ver = '1.8.5'
-          }
-          stages {
-            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'
+                post {
+                  success {
+                    archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
+                  }
                 }
               }
-            }
-            stage('Build CouchDB packages') {
-              steps {
-                sh( script: make_packages )
-                sh( script: cleanup_and_save )
-              }
-              post {
-                success {
-                  archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
-                }
+            } // stages
+            post {
+              cleanup {
+                sh 'rm -rf ${WORKSPACE}/*'
               }
-            }
-          } // stages
-          post {
-            cleanup {
-              sh 'rm -rf ${WORKSPACE}/*'
-            }
-          } // post
+            } // post
+          } // matrix
         } // stage
 
-        stage('Debian Buster amd64') {
-          agent {
-            docker {
-              image "apache/couchdbci-debian:buster-erlang-${ERLANG_VERSION}"
-              label 'docker'
-              args "${DOCKER_ARGS}"
-              registryUrl 'https://docker.io/'
-              registryCredentialsId 'dockerhub_creds'
-            }
-          }
-          environment {
-            platform = 'buster'
-            sm_ver = '60'
-          }
-          stages {
-            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'
-                }
-              }
-            }
-            stage('Build CouchDB packages') {
-              steps {
-                sh( script: make_packages )
-                sh( script: cleanup_and_save )
-              }
-              post {
-                success {
-                  archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
-                }
-              }
-            }
-          } // stages
-          post {
-            cleanup {
-              sh 'rm -rf ${WORKSPACE}/*'
-            }
-          } // post
-        } // stage
 
-        stage('Debian Buster arm64v8') {
-          when { expression { return false } }
-          agent {
-            docker {
-              image "apache/couchdbci-debian:arm64v8-buster-erlang-${ERLANG_VERSION}"
-              label 'arm64v8'
-              args "${DOCKER_ARGS}"
-              registryUrl 'https://docker.io/'
-              registryCredentialsId 'dockerhub_creds'
-            }
-          }
-          environment {
-            platform = 'buster'
-            sm_ver = '1.8.5'
-          }
-          stages {
-            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'
-                }
-              }
-            }
-            stage('Build CouchDB packages') {
-              steps {
-                sh( script: make_packages )
-                sh( script: cleanup_and_save )
-              }
-              post {
-                success {
-                  archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
-                }
-              }
-            }
-          } // stages
-          post {
-            cleanup {
-              sh 'rm -rf ${WORKSPACE}/*'
-            }
-          } // post
-        } // stage
 
+        // stage('Debian Buster arm64v8') {
+        //   when { expression { return false } }
+        //   agent {
+        //     docker {
+        //       image "apache/couchdbci-debian:arm64v8-buster-erlang-${ERLANG_VERSION}"
+        //       label 'arm64v8'
+        //       args "${DOCKER_ARGS}"
+        //       registryUrl 'https://docker.io/'
+        //       registryCredentialsId 'dockerhub_creds'
+        //     }
+        //   }
+        //   environment {
+        //     platform = 'buster'
+        //     sm_ver = '1.8.5'
+        //   }
+        //   stages {
+        //     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'
+        //         }
+        //       }
+        //     }
+        //     stage('Build CouchDB packages') {
+        //       steps {
+        //         sh( script: make_packages )
+        //         sh( script: cleanup_and_save )
+        //       }
+        //       post {
+        //         success {
+        //           archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
+        //         }
+        //       }
+        //     }
+        //   } // stages
+        //   post {
+        //     cleanup {
+        //       sh 'rm -rf ${WORKSPACE}/*'
+        //     }
+        //   } // post
+        // } // stage
 /*
   - Removed 2020.09.15 - VMs are offline
 */