summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Vatamaniuc <vatamane@apache.org>2022-09-02 01:01:45 -0400
committerNick Vatamaniuc <vatamane@apache.org>2022-09-07 23:27:19 -0400
commit5b227a0144319dbc790af553fb3a5080d8f27683 (patch)
tree606fa2ee2e56cddc59bbb62ec6580ee93f5efd16
parent0481ace8ed1f6d90563ba52276379f88a95c5f64 (diff)
downloadcouchdb-5b227a0144319dbc790af553fb3a5080d8f27683.tar.gz
Update pull request jenkinsfile to shortcut building docs
If docs are changed then docs "check" is run If only docs changed and not other files, then only docs are built and other stages are "fast-forwarded". Also, remove docs from gitignore and from rebar.config.
-rw-r--r--.gitignore1
-rw-r--r--build-aux/Jenkinsfile.pr122
-rw-r--r--rebar.config.script4
3 files changed, 116 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
index 4a02f57ce..518ec7b19 100644
--- a/.gitignore
+++ b/.gitignore
@@ -50,7 +50,6 @@ src/couch/priv/couch_ejson_compare/couch_ejson_compare.d
src/couch/priv/couch_js/**/*.d
src/couch/priv/icu_driver/couch_icu_driver.d
src/mango/src/mango_cursor_text.nocompile
-src/docs/
src/ets_lru/
src/excoveralls/
src/fauxton/
diff --git a/build-aux/Jenkinsfile.pr b/build-aux/Jenkinsfile.pr
index db0d095d0..b64a3df6e 100644
--- a/build-aux/Jenkinsfile.pr
+++ b/build-aux/Jenkinsfile.pr
@@ -24,6 +24,9 @@ cd apache-couchdb-*
make check || (make build-report && false)
'''
+docs_changed = "git diff --name-only origin/${env.CHANGE_TARGET} | grep -q '^src/docs/'"
+other_changes = "git diff --name-only origin/${env.CHANGE_TARGET} | grep -q -v '^src/docs/'"
+
pipeline {
// no top-level agent; agents must be declared for each stage
@@ -61,7 +64,107 @@ pipeline {
stages {
- stage('erlfmt') {
+ stage('Setup Env') {
+ agent {
+ docker {
+ image "${DOCKER_IMAGE_BASE}-${LOW_ERLANG_VER}"
+ label 'docker'
+ args "${DOCKER_ARGS}"
+ registryUrl 'https://docker.io/'
+ registryCredentialsId 'dockerhub_creds'
+ }
+ }
+ options {
+ timeout(time: 10, unit: 'MINUTES')
+ }
+ steps {
+ script {
+ env.DOCS_CHANGED = '0'
+ env.ONLY_DOCS_CHANGED = '0'
+ if ( sh(returnStatus: true, script: docs_changed) == 0 ) {
+ env.DOCS_CHANGED = '1'
+ if (sh(returnStatus: true, script: other_changes) == 1) {
+ env.ONLY_DOCS_CHANGED = '1'
+ }
+ }
+ }
+ }
+ post {
+ cleanup {
+ // UGH see https://issues.jenkins-ci.org/browse/JENKINS-41894
+ sh 'rm -rf ${WORKSPACE}/*'
+ }
+ }
+ } // stage 'Setup Environment'
+
+ stage('Docs Check') {
+ // Run docs `make check` stage if any docs changed
+ when {
+ beforeOptions true
+ expression { DOCS_CHANGED == '1' }
+ }
+ agent {
+ docker {
+ image "${DOCKER_IMAGE_BASE}-${LOW_ERLANG_VER}"
+ label 'docker'
+ args "${DOCKER_ARGS}"
+ registryUrl 'https://docker.io/'
+ registryCredentialsId 'dockerhub_creds'
+ }
+ }
+ options {
+ timeout(time: 15, unit: 'MINUTES')
+ }
+ steps {
+ sh '''
+ (cd src/docs && make check)
+ '''
+ }
+ post {
+ cleanup {
+ // UGH see https://issues.jenkins-ci.org/browse/JENKINS-41894
+ sh 'rm -rf ${WORKSPACE}/*'
+ }
+ }
+ } // stage Docs Check
+
+ stage('Build Docs') {
+ // Build docs separately if only docs changed. If there are other changes, docs are
+ // already built as part of `make dist`
+ when {
+ beforeOptions true
+ expression { ONLY_DOCS_CHANGED == '1' }
+ }
+ agent {
+ docker {
+ image "${DOCKER_IMAGE_BASE}-${LOW_ERLANG_VER}"
+ label 'docker'
+ args "${DOCKER_ARGS}"
+ registryUrl 'https://docker.io/'
+ registryCredentialsId 'dockerhub_creds'
+ }
+ }
+ options {
+ timeout(time: 30, unit: 'MINUTES')
+ }
+ steps {
+ sh '''
+ (cd src/docs && make html)
+ '''
+ }
+ post {
+ cleanup {
+ // UGH see https://issues.jenkins-ci.org/browse/JENKINS-41894
+ sh 'rm -rf ${WORKSPACE}/*'
+ }
+ }
+ } // stage Build Docs
+
+ stage('Erlfmt') {
+ when {
+ beforeOptions true
+ expression { ONLY_DOCS_CHANGED == '0' }
+ }
agent {
docker {
image "${DOCKER_IMAGE_BASE}-${LOW_ERLANG_VER}"
@@ -76,7 +179,6 @@ pipeline {
}
steps {
sh '''
- set
rm -rf apache-couchdb-*
./configure --skip-deps
make erlfmt-check
@@ -88,10 +190,14 @@ pipeline {
sh 'rm -rf ${WORKSPACE}/*'
}
}
- } // stage erlfmt
+ } // stage Erlfmt
- stage('Build Release Tarball') {
+ stage('Make Dist') {
+ when {
+ beforeOptions true
+ expression { ONLY_DOCS_CHANGED == '0' }
+ }
agent {
docker {
image "${DOCKER_IMAGE_BASE}-${LOW_ERLANG_VER}"
@@ -106,7 +212,6 @@ pipeline {
}
steps {
sh '''
- set
rm -rf apache-couchdb-*
./configure --spidermonkey-version 78
make dist
@@ -122,14 +227,17 @@ pipeline {
sh 'rm -rf ${WORKSPACE}/*'
}
}
- } // stage Build Release Tarball
+ } // stage Make Dist
// 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') {
-
+ when {
+ beforeOptions true
+ expression { ONLY_DOCS_CHANGED == '0' }
+ }
matrix {
axes {
axis {
diff --git a/rebar.config.script b/rebar.config.script
index fc409c576..b0c2236bc 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -147,9 +147,7 @@ DepDescs = [
{khash, "khash", {tag, "1.1.0"}},
{snappy, "snappy", {tag, "CouchDB-1.0.8"}},
-%% Non-Erlang deps
-{docs, {url, "https://github.com/apache/couchdb-documentation"},
- {tag, "3.2.1-1"}, [raw]},
+%% %% Non-Erlang deps
{fauxton, {url, "https://github.com/apache/couchdb-fauxton"},
{tag, "v1.2.8"}, [raw]},
%% Third party deps