You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2021/12/13 15:23:10 UTC

[couchdb] 01/02: Run erlfmt-check in a separate build stage

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

vatamane pushed a commit to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 874701fa26d81692d55e783e9bdff7eacd259d95
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Sun Dec 12 22:44:04 2021 -0500

    Run erlfmt-check in a separate build stage
    
    Previously, we ran it in the dist building stage. However, unlike in
    main, in 3.x that stage is run with Erlang 20 where erlfmt check is
    skipped. To fix that we run erlfmt in a separate stage with Erlang 23.
---
 build-aux/Jenkinsfile.full |  1 -
 build-aux/Jenkinsfile.pr   | 37 ++++++++++++++++++++++++++++++++++++-
 2 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/build-aux/Jenkinsfile.full b/build-aux/Jenkinsfile.full
index fd8f525..e045c2b 100644
--- a/build-aux/Jenkinsfile.full
+++ b/build-aux/Jenkinsfile.full
@@ -94,7 +94,6 @@ pipeline {
           set
           rm -rf apache-couchdb-*
           ./configure
-          make erlfmt-check
           make dist
           chmod -R a+w * .
         '''
diff --git a/build-aux/Jenkinsfile.pr b/build-aux/Jenkinsfile.pr
index 61ae43b..9902eea 100644
--- a/build-aux/Jenkinsfile.pr
+++ b/build-aux/Jenkinsfile.pr
@@ -51,6 +51,10 @@ pipeline {
     // see https://issues.jenkins.io/browse/JENKINS-61047 for why this cannot
     // be done parametrically
     LOW_ERLANG_VER = '20.3.8.26'
+
+    // erlfmt doesn't run with the lowest erlang version so we run it in a
+    // separate stage with a higher erlang version.
+    ERLFMT_ERLANG_VER = '23.3.1'
   }
 
   options {
@@ -63,6 +67,38 @@ pipeline {
   }
 
   stages {
+
+    stage('erlfmt') {
+      agent {
+        docker {
+          image "${DOCKER_IMAGE}"
+          label 'docker'
+          args "${DOCKER_ARGS}"
+          registryUrl 'https://docker.io/'
+          registryCredentialsId 'dockerhub_creds'
+        }
+      }
+      options {
+        timeout(time: 15, unit: "MINUTES")
+      }
+      steps {
+        sh '''
+          set
+          rm -rf apache-couchdb-*
+          . /usr/local/kerl/${ERLFMT_ERLANG_VER}/activate
+          ./configure --skip-deps
+          make erlfmt-check
+        '''
+      }
+      post {
+        cleanup {
+          // UGH see https://issues.jenkins-ci.org/browse/JENKINS-41894
+          sh 'rm -rf ${WORKSPACE}/*'
+        }
+      }
+    } // stage erlfmt
+
+
     stage('Build Release Tarball') {
       agent {
         docker {
@@ -82,7 +118,6 @@ pipeline {
           rm -rf apache-couchdb-*
           . /usr/local/kerl/${LOW_ERLANG_VER}/activate
           ./configure
-          make erlfmt-check
           make dist
           chmod -R a+w * .
         '''