You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by wo...@apache.org on 2019/12/12 07:38:21 UTC

[couchdb] branch jenkins-pr-jenkinsfile updated (2130820 -> cb82cd9)

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

wohali pushed a change to branch jenkins-pr-jenkinsfile
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 2130820  Add 3-Erlang Jenkinsfile for PRs
     new cb82cd9  Add 3-Erlang Jenkinsfile for PRs

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (2130820)
            \
             N -- N -- N   refs/heads/jenkins-pr-jenkinsfile (cb82cd9)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 build-aux/Jenkinsfile.pr | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)


[couchdb] 01/01: Add 3-Erlang Jenkinsfile for PRs

Posted by wo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wohali pushed a commit to branch jenkins-pr-jenkinsfile
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit cb82cd93dc44814257d2e4b842149ad3d696c2a1
Author: Joan Touzet <jo...@atypical.net>
AuthorDate: Thu Dec 12 02:10:38 2019 -0500

    Add 3-Erlang Jenkinsfile for PRs
---
 build-aux/Jenkinsfile.pr | 254 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 254 insertions(+)

diff --git a/build-aux/Jenkinsfile.pr b/build-aux/Jenkinsfile.pr
new file mode 100644
index 0000000..e2c0334
--- /dev/null
+++ b/build-aux/Jenkinsfile.pr
@@ -0,0 +1,254 @@
+#!groovy
+//
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+// DRYing out the Jenkinsfile...
+
+build_and_test = '''
+mkdir -p ${COUCHDB_IO_LOG_DIR}
+rm -rf build
+mkdir build
+cd build
+tar -xf ${WORKSPACE}/apache-couchdb-*.tar.gz
+cd apache-couchdb-*
+. /usr/local/kerl/${KERL_VER}/activate
+./configure --with-curl
+make check || (build-aux/logfile-uploader.py && false)
+'''
+
+make_packages = '''
+git clone https://github.com/apache/couchdb-pkg
+rm -rf couchdb
+mkdir couchdb
+cp ${WORKSPACE}/apache-couchdb-*.tar.gz couchdb
+tar -xf ${WORKSPACE}/apache-couchdb-*.tar.gz -C couchdb
+cd couchdb-pkg
+make ${platform} PLATFORM=${platform}
+'''
+
+cleanup_and_save = '''
+rm -rf ${WORKSPACE}/pkgs/${platform}
+mkdir -p ${WORKSPACE}/pkgs/${platform}
+mv ${WORKSPACE}/rpmbuild/RPMS/$(arch)/*rpm ${WORKSPACE}/pkgs/${platform} || true
+mv ${WORKSPACE}/couchdb/*.deb ${WORKSPACE}/pkgs/${platform} || true
+'''
+
+
+pipeline {
+
+  // no top-level agent; agents must be declared for each stage
+  agent any
+
+  environment {
+    COUCHAUTH = credentials('couchdb_vm2_couchdb')
+    recipient = 'notifications@couchdb.apache.org'
+    COUCHDB_IO_LOG_DIR = '/tmp/couchjslogs'
+    // Following fix an issue with git <= 2.6.5 where no committer
+    // name or email are present for reflog, required for git clone
+    GIT_COMMITTER_NAME = 'Jenkins User'
+    GIT_COMMITTER_EMAIL = 'couchdb@apache.org'
+    LOW_ERLANG_VER = '20.3.8.11'
+    MID_ERLANG_VER = '20.3.8.24'
+    HIGH_ERLANG_VER = '22.2'
+  }
+
+  options {
+    buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
+    // This fails the build immediately if any parallel step fails
+    parallelsAlwaysFailFast()
+    preserveStashes(buildCount: 10)
+    timeout(time: 3, unit: 'HOURS')
+    timestamps()
+  }
+
+  stages {
+    stage('Build Release Tarball') {
+      agent {
+        // https://github.com/jenkins-infra/jenkins.io/blob/master/Jenkinsfile#64
+        // We need the jenkins user mapped inside of the image
+        // npm config cache below is required because /home/jenkins doesn't
+        // ACTUALLY exist in the image
+        docker {
+          image 'couchdbdev/debian-buster-erlang-all:latest'
+          alwaysPull true
+          args '-e npm_config_cache=npm-cache -e HOME=. -v=/etc/passwd:/etc/passwd -v /etc/group:/etc/group'
+        }
+      }
+      options {
+        timeout(time: 15, unit: "MINUTES")
+      }
+      steps {
+        sh '''
+          set
+          rm -rf apache-couchdb-*
+	  . /usr/local/kerl/${LOW_ERLANG_VER}/activate
+          ./configure --with-curl
+          make dist
+          chmod -R a+w * .
+        '''
+      }
+      post {
+        success {
+          stash includes: 'apache-couchdb-*.tar.gz', name: 'tarball'
+          archiveArtifacts artifacts: 'apache-couchdb-*.tar.gz', fingerprint: true
+        }
+        cleanup {
+          // UGH see https://issues.jenkins-ci.org/browse/JENKINS-41894
+          sh 'rm -rf ${WORKSPACE}/*'
+        }
+      }
+    } // stage Build Release Tarball
+
+    // TODO Rework once Improved Docker Pipeline Engine is released
+    // https://issues.jenkins-ci.org/browse/JENKINS-47962
+    // https://issues.jenkins-ci.org/browse/JENKINS-48050
+
+    stage('make check') {
+
+      parallel {
+
+        stage('Low') {
+          agent {
+            docker {
+              image 'couchdbdev/debian-buster-erlang-all:latest'
+              alwaysPull true
+              customWorkspace pwd() + '/LOW'
+            }
+          }
+	  environment {
+	    KERL_VER = '${LOW_ERLANG_VER}'
+	  }
+          options {
+            skipDefaultCheckout()
+            timeout(time: 90, unit: "MINUTES")
+          }
+          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'
+                }
+              }
+            }
+          } // stages
+          post {
+            cleanup {
+              sh 'rm -rf ${WORKSPACE}/*'
+            }
+          } // post
+        } // stage
+
+        stage('Mid) {
+          agent {
+            docker {
+              image 'couchdbdev/debian-buster-erlang-all:latest'
+              alwaysPull true
+              customWorkspace pwd() + '/MID'
+            }
+          }
+	  environment {
+	    KERL_VER = '${MID_ERLANG_VER}'
+	  }
+          options {
+            skipDefaultCheckout()
+            timeout(time: 90, unit: "MINUTES")
+          }
+          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'
+                }
+              }
+            }
+          } // stages
+          post {
+            cleanup {
+              sh 'rm -rf ${WORKSPACE}/*'
+            }
+          } // post
+        } // stage
+
+        stage('HIGH') {
+          agent {
+            docker {
+              image 'couchdbdev/debian-buster-erlang-all:latest'
+              alwaysPull true
+              customWorkspace pwd() + '/HIGH'
+            }
+          }
+	  environment {
+	    KERL_VER = '${HIGH_ERLANG_VER}'
+	  }
+          options {
+            skipDefaultCheckout()
+            timeout(time: 90, unit: "MINUTES")
+          }
+          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'
+                }
+              }
+            }
+          } // stages
+          post {
+            cleanup {
+              sh 'rm -rf ${WORKSPACE}/*'
+            }
+          } // post
+        } // stage
+
+      } // parallel
+    } // stage "Make Check"
+  } // stages
+
+  post {
+    success {
+      mail to: "${env.recipient}",
+        replyTo: "${env.recipient}",
+        subject: "[Jenkins] SUCCESS: ${currentBuild.fullDisplayName}",
+        body: "PR passed. ${env.RUN_DISPLAY_URL}"
+    }
+    unstable {
+      mail to: "${env.recipient}",
+        replyTo: "${env.recipient}",
+        subject: "[Jenkins] SUCCESS: ${currentBuild.fullDisplayName}",
+        body: "Eep! PR is unstable... ${env.RUN_DISPLAY_URL}"
+    }
+    failure {
+      mail to: "${env.recipient}",
+        replyTo: "${env.recipient}",
+        subject: "[Jenkins] FAILURE: ${currentBuild.fullDisplayName}",
+        body: "PR failed. ${env.RUN_DISPLAY_URL}"
+    }
+    cleanup {
+      sh 'rm -rf ${COUCHDB_IO_LOG_DIR}'
+    }
+  }
+
+} // pipeline