diff options
author | Nick Vatamaniuc <vatamane@apache.org> | 2021-12-12 22:44:04 -0500 |
---|---|---|
committer | Nick Vatamaniuc <nickva@users.noreply.github.com> | 2021-12-13 10:22:42 -0500 |
commit | 874701fa26d81692d55e783e9bdff7eacd259d95 (patch) | |
tree | fc52cb9573cc34b772921c71cea94d52ef1d941b | |
parent | 9ad86ae2f08d0d6f74f03e138f33e21970a1c3fb (diff) | |
download | couchdb-874701fa26d81692d55e783e9bdff7eacd259d95.tar.gz |
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.
-rw-r--r-- | build-aux/Jenkinsfile.full | 1 | ||||
-rw-r--r-- | 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 fd8f525e5..e045c2b6f 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 61ae43bba..9902eea35 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 * . ''' |