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 2019/08/01 11:29:24 UTC

[couchdb] branch jenkins-junit-reports-and-jenkins-env updated: Try getting tmp dir from Jenkinsfile

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

kocolosk pushed a commit to branch jenkins-junit-reports-and-jenkins-env
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/jenkins-junit-reports-and-jenkins-env by this push:
     new 3f3f40e  Try getting tmp dir from Jenkinsfile
3f3f40e is described below

commit 3f3f40e59430a4dc4ebc45d5b4b46320ff3b7a42
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Thu Aug 1 07:28:54 2019 -0400

    Try getting tmp dir from Jenkinsfile
---
 Jenkinsfile | 471 +++++++++++++++++++++++++++++++-----------------------------
 1 file changed, 240 insertions(+), 231 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index a0c5af7..d6edf84 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -17,10 +17,14 @@
 build_script = '''
 mkdir -p ${COUCHDB_IO_LOG_DIR}
 
+env
+
 echo
 echo "Build CouchDB from tarball & test"
-builddir=$(mktemp -d)
-#cd ${builddir}
+#builddir=$(mktemp -d)
+cd ${BUILDDIR}
+mkdir -p build
+cd build
 tar -xf ${WORKSPACE}/apache-couchdb-*.tar.gz
 cd apache-couchdb-*
 ./configure --with-curl
@@ -29,7 +33,7 @@ find . -name "*.xml"
 
 echo
 echo "Build CouchDB packages"
-cd ${builddir}
+cd ${BUILDDIR}
 git clone https://github.com/apache/couchdb-pkg
 mkdir couchdb
 cp ${WORKSPACE}/apache-couchdb-*.tar.gz couchdb
@@ -133,13 +137,16 @@ pipeline {
             // deleteDir is OK here because we're not inside of a Docker container!
             deleteDir()
             unstash 'tarball'
-            withEnv(['HOME='+pwd()]) {
+            withEnv(['HOME='+pwd(), 'BUILDDIR='+pwd(tmp: true)]) {
               sh '''
                 mkdir -p $COUCHDB_IO_LOG_DIR
 
+                env
+
                 # Build CouchDB from tarball & test
-                # builddir=$(mktemp -d)
-                # cd $builddir
+                cd ${BUILDDIR}
+                mkdir -p build
+                cd build
                 tar -xf $WORKSPACE/apache-couchdb-*.tar.gz
                 cd apache-couchdb-*
                 ./configure --with-curl
@@ -153,11 +160,11 @@ pipeline {
           } // steps
           post {
             always {
-              junit 'apache-couchdb-*/src/*/.eunit/*.xml'
-              junit 'apache-couchdb-*/_build/*/lib/couchdbtest/*.xml'
+              junit '${BUILDDIR}/build/apache-couchdb-*/src/*/.eunit/*.xml'
+              junit '${BUILDDIR}/build/apache-couchdb-*/_build/*/lib/couchdbtest/*.xml'
             }
             cleanup {
-              sh 'rm -rf apache-couchdb-* ${COUCHDB_IO_LOG_DIR}'
+              sh 'rm -rf ${BUILDDIR} ${COUCHDB_IO_LOG_DIR}'
             }
           } // post
         } // stage FreeBSD
@@ -177,231 +184,233 @@ pipeline {
           environment {
             platform = 'centos6'
           }
-          steps {
-            sh 'rm -f apache-couchdb-*.tar.gz'
-            unstash 'tarball'
-            sh( script: build_script )
-          } // steps
-          post {
-            always {
-              junit 'apache-couchdb-*/src/*/.eunit/*.xml'
-              junit 'apache-couchdb-*/_build/*/lib/couchdbtest/*.xml'
-            }
-            success {
-              archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
-            }
-            cleanup {
-              sh 'rm -rf ${builddir} ${COUCHDB_IO_LOG_DIR}'
-            }
-          } // post
-        } // stage
-
-        stage('CentOS 7') {
-          agent {
-            docker {
-              image 'couchdbdev/centos-7-erlang-19.3.6:latest'
-              alwaysPull true
-              label 'ubuntu'
-            }
-          }
-          options {
-            skipDefaultCheckout()
-            timeout(time: 90, unit: "MINUTES")
-          }
-          environment {
-            platform = 'centos7'
-          }
-          steps {
-            sh 'rm -f apache-couchdb-*.tar.gz'
-            unstash 'tarball'
-            sh( script: build_script )
-          } // steps
-          post {
-            always {
-              junit 'apache-couchdb-*/src/*/.eunit/*.xml'
-              junit 'apache-couchdb-*/_build/*/lib/couchdbtest/*.xml'
-            }
-            success {
-              archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
-            }
-            cleanup {
-              sh 'rm -rf ${builddir} ${COUCHDB_IO_LOG_DIR}'
-            }
-          } // post
-        } // stage
-
-        stage('Ubuntu Xenial') {
-          agent {
-            docker {
-              image 'couchdbdev/ubuntu-xenial-erlang-19.3.6:latest'
-              alwaysPull true
-              label 'ubuntu'
-            }
-          }
-          options {
-            skipDefaultCheckout()
-            timeout(time: 90, unit: "MINUTES")
-          }
-          environment {
-            platform = 'xenial'
-          }
-          steps {
-            sh 'rm -f apache-couchdb-*.tar.gz'
-            unstash 'tarball'
-            sh( script: build_script )
-          } // steps
-          post {
-            always {
-              junit 'apache-couchdb-*/src/*/.eunit/*.xml'
-              junit 'apache-couchdb-*/_build/*/lib/couchdbtest/*.xml'
-            }
-            success {
-              archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
-            }
-            cleanup {
-              sh 'rm -rf ${builddir} ${COUCHDB_IO_LOG_DIR}'
-            }
-          } // post
-        } // stage
-
-        stage('Ubuntu Bionic') {
-          agent {
-            docker {
-              image 'couchdbdev/ubuntu-bionic-erlang-19.3.6:latest'
-              alwaysPull true
-              label 'ubuntu'
-            }
-          }
-          options {
-            skipDefaultCheckout()
-            timeout(time: 90, unit: "MINUTES")
-          }
-          environment {
-            platform = 'bionic'
-          }
-          steps {
-            sh 'rm -f apache-couchdb-*.tar.gz'
-            unstash 'tarball'
-            sh( script: build_script )
-          } // steps
-          post {
-            always {
-              junit 'apache-couchdb-*/src/*/.eunit/*.xml'
-              junit 'apache-couchdb-*/_build/*/lib/couchdbtest/*.xml'
-            }
-            success {
-              archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
-            }
-            cleanup {
-              sh 'rm -rf ${builddir} ${COUCHDB_IO_LOG_DIR}'
-            }
-          } // post
-        } // stage
-
-        stage('Debian Jessie') {
-          agent {
-            docker {
-              image 'couchdbdev/debian-jessie-erlang-19.3.6:latest'
-              alwaysPull true
-              label 'ubuntu'
-            }
-          }
-          options {
-            skipDefaultCheckout()
-            timeout(time: 90, unit: "MINUTES")
-          }
-          environment {
-            platform = 'jessie'
-          }
-          steps {
-            sh 'rm -f apache-couchdb-*.tar.gz'
-            unstash 'tarball'
-            sh( script: build_script )
-          } // steps
-          post {
-            always {
-              junit 'apache-couchdb-*/src/*/.eunit/*.xml'
-              junit 'apache-couchdb-*/_build/*/lib/couchdbtest/*.xml'
-            }
-            success {
-              archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
-            }
-            cleanup {
-              sh 'rm -rf ${builddir} ${COUCHDB_IO_LOG_DIR}'
-            }
-          } // post
-        } // stage
-
-        stage('Debian Stretch x86_64') {
-          agent {
-            docker {
-              image 'couchdbdev/debian-stretch-erlang-19.3.6:latest'
-              alwaysPull true
-              label 'ubuntu'
-            }
-          }
-          options {
-            skipDefaultCheckout()
-            timeout(time: 90, unit: "MINUTES")
-          }
-          environment {
-            platform = 'stretch'
-          }
-          steps {
-            sh 'rm -f apache-couchdb-*.tar.gz'
-            unstash 'tarball'
-            sh( script: build_script )
-          } // steps
-          post {
-            always {
-              junit 'apache-couchdb-*/src/*/.eunit/*.xml'
-              junit 'apache-couchdb-*/_build/*/lib/couchdbtest/*.xml'
-            }
-            success {
-              archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
-            }
-            cleanup {
-              sh 'rm -rf ${builddir} ${COUCHDB_IO_LOG_DIR}'
-            }
-          } // post
-        } // stage
-
-        stage('Debian Stretch aarch64') {
-          agent {
-            docker {
-              image 'couchdbdev/aarch64-debian-stretch-erlang-20.3.8.20:latest'
-              alwaysPull true
-              label 'arm'
-            }
-          }
-          options {
-            skipDefaultCheckout()
-            timeout(time: 90, unit: "MINUTES")
-          }
-          environment {
-            platform = 'stretch'
-          }
-          steps {
-            sh 'rm -f apache-couchdb-*.tar.gz'
-            unstash 'tarball'
-            withEnv(['MIX_HOME='+pwd()]) {
+          withEnv(['BUILDDIR='+pwd(tmp: true)]) {
+            steps {
+              sh 'rm -f apache-couchdb-*.tar.gz'
+              unstash 'tarball'
               sh( script: build_script )
-            }
-          } // steps
-          post {
-            always {
-              junit 'apache-couchdb-*/src/*/.eunit/*.xml'
-              junit 'apache-couchdb-*/_build/*/lib/couchdbtest/*.xml'
-            }
-            success {
-              archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
-            }
-            cleanup {
-              sh 'rm -rf ${builddir} ${COUCHDB_IO_LOG_DIR}'
-            }
-          } // post
+            } // steps
+            post {
+              always {
+                junit '${BUILDDIR}/build/apache-couchdb-*/src/*/.eunit/*.xml'
+                junit '${BUILDDIR}/build/apache-couchdb-*/_build/*/lib/couchdbtest/*.xml'
+              }
+              success {
+                archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
+              }
+              cleanup {
+                sh 'rm -rf ${BUILDDIR} ${COUCHDB_IO_LOG_DIR}'
+              }
+            } // post
+          } // withEnv
         } // stage
 
+        // stage('CentOS 7') {
+        //   agent {
+        //     docker {
+        //       image 'couchdbdev/centos-7-erlang-19.3.6:latest'
+        //       alwaysPull true
+        //       label 'ubuntu'
+        //     }
+        //   }
+        //   options {
+        //     skipDefaultCheckout()
+        //     timeout(time: 90, unit: "MINUTES")
+        //   }
+        //   environment {
+        //     platform = 'centos7'
+        //   }
+        //   steps {
+        //     sh 'rm -f apache-couchdb-*.tar.gz'
+        //     unstash 'tarball'
+        //     sh( script: build_script )
+        //   } // steps
+        //   post {
+        //     always {
+        //       junit 'build/apache-couchdb-*/src/*/.eunit/*.xml'
+        //       junit 'build/apache-couchdb-*/_build/*/lib/couchdbtest/*.xml'
+        //     }
+        //     success {
+        //       archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
+        //     }
+        //     cleanup {
+        //       sh 'rm -rf ${builddir} ${COUCHDB_IO_LOG_DIR}'
+        //     }
+        //   } // post
+        // } // stage
+
+        // stage('Ubuntu Xenial') {
+        //   agent {
+        //     docker {
+        //       image 'couchdbdev/ubuntu-xenial-erlang-19.3.6:latest'
+        //       alwaysPull true
+        //       label 'ubuntu'
+        //     }
+        //   }
+        //   options {
+        //     skipDefaultCheckout()
+        //     timeout(time: 90, unit: "MINUTES")
+        //   }
+        //   environment {
+        //     platform = 'xenial'
+        //   }
+        //   steps {
+        //     sh 'rm -f apache-couchdb-*.tar.gz'
+        //     unstash 'tarball'
+        //     sh( script: build_script )
+        //   } // steps
+        //   post {
+        //     always {
+        //       junit 'build/apache-couchdb-*/src/*/.eunit/*.xml'
+        //       junit 'build/apache-couchdb-*/_build/*/lib/couchdbtest/*.xml'
+        //     }
+        //     success {
+        //       archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
+        //     }
+        //     cleanup {
+        //       sh 'rm -rf ${builddir} ${COUCHDB_IO_LOG_DIR}'
+        //     }
+        //   } // post
+        // } // stage
+
+        // stage('Ubuntu Bionic') {
+        //   agent {
+        //     docker {
+        //       image 'couchdbdev/ubuntu-bionic-erlang-19.3.6:latest'
+        //       alwaysPull true
+        //       label 'ubuntu'
+        //     }
+        //   }
+        //   options {
+        //     skipDefaultCheckout()
+        //     timeout(time: 90, unit: "MINUTES")
+        //   }
+        //   environment {
+        //     platform = 'bionic'
+        //   }
+        //   steps {
+        //     sh 'rm -f apache-couchdb-*.tar.gz'
+        //     unstash 'tarball'
+        //     sh( script: build_script )
+        //   } // steps
+        //   post {
+        //     always {
+        //       junit 'build/apache-couchdb-*/src/*/.eunit/*.xml'
+        //       junit 'build/apache-couchdb-*/_build/*/lib/couchdbtest/*.xml'
+        //     }
+        //     success {
+        //       archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
+        //     }
+        //     cleanup {
+        //       sh 'rm -rf ${builddir} ${COUCHDB_IO_LOG_DIR}'
+        //     }
+        //   } // post
+        // } // stage
+
+        // stage('Debian Jessie') {
+        //   agent {
+        //     docker {
+        //       image 'couchdbdev/debian-jessie-erlang-19.3.6:latest'
+        //       alwaysPull true
+        //       label 'ubuntu'
+        //     }
+        //   }
+        //   options {
+        //     skipDefaultCheckout()
+        //     timeout(time: 90, unit: "MINUTES")
+        //   }
+        //   environment {
+        //     platform = 'jessie'
+        //   }
+        //   steps {
+        //     sh 'rm -f apache-couchdb-*.tar.gz'
+        //     unstash 'tarball'
+        //     sh( script: build_script )
+        //   } // steps
+        //   post {
+        //     always {
+        //       junit 'build/apache-couchdb-*/src/*/.eunit/*.xml'
+        //       junit 'build/apache-couchdb-*/_build/*/lib/couchdbtest/*.xml'
+        //     }
+        //     success {
+        //       archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
+        //     }
+        //     cleanup {
+        //       sh 'rm -rf ${builddir} ${COUCHDB_IO_LOG_DIR}'
+        //     }
+        //   } // post
+        // } // stage
+
+        // stage('Debian Stretch x86_64') {
+        //   agent {
+        //     docker {
+        //       image 'couchdbdev/debian-stretch-erlang-19.3.6:latest'
+        //       alwaysPull true
+        //       label 'ubuntu'
+        //     }
+        //   }
+        //   options {
+        //     skipDefaultCheckout()
+        //     timeout(time: 90, unit: "MINUTES")
+        //   }
+        //   environment {
+        //     platform = 'stretch'
+        //   }
+        //   steps {
+        //     sh 'rm -f apache-couchdb-*.tar.gz'
+        //     unstash 'tarball'
+        //     sh( script: build_script )
+        //   } // steps
+        //   post {
+        //     always {
+        //       junit 'build/apache-couchdb-*/src/*/.eunit/*.xml'
+        //       junit 'build/apache-couchdb-*/_build/*/lib/couchdbtest/*.xml'
+        //     }
+        //     success {
+        //       archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
+        //     }
+        //     cleanup {
+        //       sh 'rm -rf ${builddir} ${COUCHDB_IO_LOG_DIR}'
+        //     }
+        //   } // post
+        // } // stage
+
+        // stage('Debian Stretch aarch64') {
+        //   agent {
+        //     docker {
+        //       image 'couchdbdev/aarch64-debian-stretch-erlang-20.3.8.20:latest'
+        //       alwaysPull true
+        //       label 'arm'
+        //     }
+        //   }
+        //   options {
+        //     skipDefaultCheckout()
+        //     timeout(time: 90, unit: "MINUTES")
+        //   }
+        //   environment {
+        //     platform = 'stretch'
+        //   }
+        //   steps {
+        //     sh 'rm -f apache-couchdb-*.tar.gz'
+        //     unstash 'tarball'
+        //     withEnv(['MIX_HOME='+pwd()]) {
+        //       sh( script: build_script )
+        //     }
+        //   } // steps
+        //   post {
+        //     always {
+        //       junit 'build/apache-couchdb-*/src/*/.eunit/*.xml'
+        //       junit 'build/apache-couchdb-*/_build/*/lib/couchdbtest/*.xml'
+        //     }
+        //     success {
+        //       archiveArtifacts artifacts: 'pkgs/**', fingerprint: true
+        //     }
+        //     cleanup {
+        //       sh 'rm -rf ${builddir} ${COUCHDB_IO_LOG_DIR}'
+        //     }
+        //   } // post
+        // } // stage
+
       } // parallel
     } // stage "Make Check"