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/17 02:58:44 UTC

[couchdb] branch jenkins-dynamic-matrix updated: Attempt a simplified container stage

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 6fa8296  Attempt a simplified container stage
6fa8296 is described below

commit 6fa8296196e9f0bdafe6b185314d3b4596a671a5
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Sun Jan 16 21:58:32 2022 -0500

    Attempt a simplified container stage
---
 build-aux/Jenkinsfile.full | 261 +++++++++++++++++++++++----------------------
 1 file changed, 134 insertions(+), 127 deletions(-)

diff --git a/build-aux/Jenkinsfile.full b/build-aux/Jenkinsfile.full
index 2df2633..78057d2 100644
--- a/build-aux/Jenkinsfile.full
+++ b/build-aux/Jenkinsfile.full
@@ -50,47 +50,47 @@ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
 ERLANG_VERSION = '24.2'
 
 meta = [
-  // 'centos7': [
-  //   name: 'CentOS 7',
-  //   spidermonkey_vsn: '1.8.5',
-  //   image: "apache/couchdbci-centos:7-erlang-${ERLANG_VERSION}"
-  // ],
-
-  // 'centos8': [
-  //   name: 'CentOS 8',
-  //   spidermonkey_vsn: '60',
-  //   image: "apache/couchdbci-centos:8-erlang-${ERLANG_VERSION}"
-  // ],
-
-  // 'bionic': [
-  //   name: 'Ubuntu 18.04',
-  //   spidermonkey_vsn: '1.8.5',
-  //   image: "apache/couchdbci-ubuntu:bionic-erlang-${ERLANG_VERSION}"
-  // ],
-
-  // 'focal': [
-  //   name: 'Ubuntu 20.04',
-  //   spidermonkey_vsn: '68',
-  //   image: "apache/couchdbci-ubuntu:focal-erlang-${ERLANG_VERSION}"
-  // ],
-
-  // 'stretch': [
-  //   name: 'Debian 9',
-  //   spidermonkey_vsn: '1.8.5',
-  //   image: "apache/couchdbci-debian:stretch-erlang-${ERLANG_VERSION}"
-  // ],
-
-  // 'buster': [
-  //   name: 'Debian 10',
-  //   spidermonkey_vsn: '60',
-  //   image: "apache/couchdbci-debian:buster-erlang-${ERLANG_VERSION}"
-  // ],
-
-  // 'bullseye': [
-  //   name: 'Debian 11',
-  //   spidermonkey_vsn: '78',
-  //   image: "apache/couchdbci-debian:bullseye-erlang-${ERLANG_VERSION}"
-  // ],
+  'centos7': [
+    name: 'CentOS 7',
+    spidermonkey_vsn: '1.8.5',
+    image: "apache/couchdbci-centos:7-erlang-${ERLANG_VERSION}"
+  ],
+
+  'centos8': [
+    name: 'CentOS 8',
+    spidermonkey_vsn: '60',
+    image: "apache/couchdbci-centos:8-erlang-${ERLANG_VERSION}"
+  ],
+
+  'bionic': [
+    name: 'Ubuntu 18.04',
+    spidermonkey_vsn: '1.8.5',
+    image: "apache/couchdbci-ubuntu:bionic-erlang-${ERLANG_VERSION}"
+  ],
+
+  'focal': [
+    name: 'Ubuntu 20.04',
+    spidermonkey_vsn: '68',
+    image: "apache/couchdbci-ubuntu:focal-erlang-${ERLANG_VERSION}"
+  ],
+
+  'stretch': [
+    name: 'Debian 9',
+    spidermonkey_vsn: '1.8.5',
+    image: "apache/couchdbci-debian:stretch-erlang-${ERLANG_VERSION}"
+  ],
+
+  'buster': [
+    name: 'Debian 10',
+    spidermonkey_vsn: '60',
+    image: "apache/couchdbci-debian:buster-erlang-${ERLANG_VERSION}"
+  ],
+
+  'bullseye': [
+    name: 'Debian 11',
+    spidermonkey_vsn: '78',
+    image: "apache/couchdbci-debian:bullseye-erlang-${ERLANG_VERSION}"
+  ],
 
   'freebsd': [
     name: 'FreeBSD',
@@ -114,35 +114,29 @@ gnu_make = ['freebsd': 'gmake', 'macos': 'make']
 def generateNativeStage(platform) {
   return {
     stage(meta[platform].name) {
-      // options {
-      //   skipDefaultCheckout()
-      // }
-
       node(platform) {
         timeout(time: 90, unit: "MINUTES") {
-          // steps {
-            // 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'
-              }
+          // 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'
             }
-          // }
+          }
 
           // post {
           //   always {
@@ -167,79 +161,92 @@ def generateNativeStage(platform) {
 def generateContainerStage(platform) {
   return {
     stage(meta[platform].name) {
-      agent {
-        docker {
-          image meta[platform].image
-          label 'docker'
-          args "${DOCKER_ARGS}"
-          registryUrl 'https://docker.io/'
-          registryCredentialsId 'dockerhub_creds'
-        }
-      }
-
-      options {
-        skipDefaultCheckout()
-        timeout(time: 90, unit: "MINUTES")
-      }
-
-      stages {
-        stage('Build from tarball & test') {
-          steps {
-            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'
-            }
-          }
-          post {
-            always {
-              junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml'
-            }
-            failure {
-              dir( "${platform}/build/couchdb" ) {
-                sh 'make build-report'
+      node('docker') {
+        timeout(time: 90, unit: "MINUTES") {
+          docker.withRegistry('https://docker.io/', 'dockerhub_creds') {
+            docker.image(meta[platform].image).inside("${DOCKER_ARGS}") {
+              stages {
+                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('Build CouchDB packages') {
-          steps {
-            unstash 'tarball'
-            sh( script: make_packages, label: 'Build packages' )
-            sh( script: cleanup_and_save, label: 'Stage package artifacts for archival' )
-          }
-          post {
-            success {
-              archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
-            }
-          }
-        }
-      }
-
-      post {
-        cleanup {
-          sh 'rm -rf ${WORKSPACE}/*'
-        }
       }
     }
   }
 }
+      // stages {
+      //   stage('Build from tarball & test') {
+      //     steps {
+      //       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'
+      //       }
+      //     }
+      //     post {
+      //       always {
+      //         junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml'
+      //       }
+      //       failure {
+      //         dir( "${platform}/build/couchdb" ) {
+      //           sh 'make build-report'
+      //         }
+      //       }
+      //     }
+      //   }
+
+      //   stage('Build CouchDB packages') {
+      //     steps {
+      //       unstash 'tarball'
+      //       sh( script: make_packages, label: 'Build packages' )
+      //       sh( script: cleanup_and_save, label: 'Stage package artifacts for archival' )
+      //     }
+      //     post {
+      //       success {
+      //         archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
+      //       }
+      //     }
+      //   }
+//       }
+
+//       post {
+//         cleanup {
+//           sh 'rm -rf ${WORKSPACE}/*'
+//         }
+//       }
+//     }
+//   }
+// }
 
 def parallelStagesMap = meta.collectEntries { key, values ->
   if (values.image) {
-    ["${key}": generateContainerStage(key)]
+    ["${values.name}": generateContainerStage(key)]
   }
   else {
-    ["${key}": generateNativeStage(key)]
+    ["${values.name}": generateNativeStage(key)]
   }
 }