Merge branch 'main' into jenkins-add-windows-pipeline
diff --git a/Makefile.win b/Makefile.win
index 13b83f7..d24634c 100644
--- a/Makefile.win
+++ b/Makefile.win
@@ -151,7 +151,7 @@
eunit: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1
eunit: couch
@set COUCHDB_VERSION=$(COUCHDB_VERSION) && set COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) && $(REBAR) setup_eunit 2> nul
- @cmd /c "FOR %d IN ($(subdirs)) DO set COUCHDB_VERSION=$(COUCHDB_VERSION) & set COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) & $(REBAR) -r eunit $(EUNIT_OPTS) apps=%d"
+ @cmd /c "FOR %d IN ($(subdirs)) DO set COUCHDB_VERSION=$(COUCHDB_VERSION) & set COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) & $(REBAR) -r eunit $(EUNIT_OPTS) apps=%d || exit /b 1"
.PHONY: exunit
# target: exunit - Run ExUnit tests
@@ -361,7 +361,7 @@
@echo .
@echo To install CouchDB into your system, copy the rel\couchdb
@echo to your desired installation location. For example:
- @echo xcopy /E rel\couchdb C:\CouchDB\
+ @echo xcopy /E rel\couchdb C:\CouchDB\
@echo .
################################################################################
diff --git a/build-aux/Jenkinsfile.full b/build-aux/Jenkinsfile.full
index bce9f14..8c0e7cb 100644
--- a/build-aux/Jenkinsfile.full
+++ b/build-aux/Jenkinsfile.full
@@ -79,14 +79,20 @@
image: "apache/couchdbci-debian:bullseye-erlang-${ERLANG_VERSION}"
],
- // Skip freebsd builds for now as adviced by node owner
+ 'win-2022': [
+ name: 'Windows 2022',
+ spidermonkey_vsn: '91',
+ node_label: 'win'
+ ],
+
+ // Skip freebsd builds for now as advised by node owner
// 'freebsd': [
// name: 'FreeBSD',
// spidermonkey_vsn: '1.8.5',
// gnu_make: 'gmake'
// ],
- 'macos': [
+ 'macos': [
name: 'macOS',
spidermonkey_vsn: '91',
gnu_make: 'make'
@@ -103,7 +109,7 @@
// configure the worker environment.
// Returns a build stage suitable for non-containerized environments (currently
-// macOS and FreeBSD). Coincidentally we do not currently support automated
+// macOS, FreeBSD and Windows). Coincidentally we do not currently support automated
// package generation on these platforms. This method in invoked when we create
// `parallelStagesMap` below.
def generateNativeStage(platform) {
@@ -111,46 +117,91 @@
stage(platform) {
node(platform) {
timeout(time: 90, unit: "MINUTES") {
- try {
- // deleteDir is OK here because we're not inside of a Docker container!
- deleteDir()
- unstash 'tarball'
- withEnv([
- 'HOME='+pwd(),
- 'PATH+USRLOCAL=/usr/local/bin',
- 'MAKE='+meta[platform].gnu_make
- ]) {
- sh( script: "mkdir -p ${platform}/build", label: 'Create build directories' )
- sh( script: "tar -xf apache-couchdb-*.tar.gz -C ${platform}/build --strip-components=1", label: 'Unpack release' )
- dir( "${platform}/build" ) {
- sh "./configure --skip-deps --spidermonkey-version ${meta[platform].spidermonkey_vsn}"
- sh '$MAKE'
- sh '$MAKE eunit'
- sh '$MAKE elixir-suite'
- sh '$MAKE exunit'
- sh '$MAKE mango-test'
- sh '$MAKE weatherreport-test'
+ // Steps to configure and build CouchDB on *nix platforms
+ if (isUnix()) {
+ try {
+ // deleteDir is OK here because we're not inside of a Docker container!
+ deleteDir()
+ unstash 'tarball'
+ withEnv([
+ 'HOME='+pwd(),
+ 'PATH+USRLOCAL=/usr/local/bin',
+ 'MAKE='+meta[platform].gnu_make
+ ]) {
+ sh( script: "mkdir -p ${platform}/build", label: 'Create build directories' )
+ sh( script: "tar -xf apache-couchdb-*.tar.gz -C ${platform}/build --strip-components=1", label: 'Unpack release' )
+ dir( "${platform}/build" ) {
+ sh "./configure --skip-deps --spidermonkey-version ${meta[platform].spidermonkey_vsn}"
+ sh '$MAKE'
+ sh '$MAKE eunit'
+ sh '$MAKE elixir-suite'
+ sh '$MAKE exunit'
+ sh '$MAKE mango-test'
+ sh '$MAKE weatherreport-test'
+ }
}
}
- }
- catch (err) {
- sh 'ls -l ${WORKSPACE}'
- withEnv([
- 'HOME='+pwd(),
- 'PATH+USRLOCAL=/usr/local/bin',
- 'MAKE='+meta[platform].gnu_make
- ]) {
- dir( "${platform}/build" ) {
- sh 'ls -l'
- sh '${MAKE} build-report'
+ catch (err) {
+ sh 'ls -l ${WORKSPACE}'
+ withEnv([
+ 'HOME='+pwd(),
+ 'PATH+USRLOCAL=/usr/local/bin',
+ 'MAKE='+meta[platform].gnu_make
+ ]) {
+ dir( "${platform}/build" ) {
+ sh 'ls -l'
+ sh '${MAKE} build-report'
+ }
+ }
+ error("Build step failed with error: ${err.getMessage()}")
+ }
+ finally {
+ junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml'
+ sh 'killall -9 beam.smp || true'
+ sh 'rm -rf ${WORKSPACE}/*'
+ }
+ } else {
+ //steps to configure and build CouchDB on Windows platforms
+ stage("${meta[platform].name} - build & test") {
+ try {
+ // deleteDir is OK here because we're not inside of a Docker container!
+ deleteDir()
+ unstash 'tarball'
+ powershell( script: "git clone https://github.com/apache/couchdb-glazier", label: 'Cloning couchdb-glazier repository' )
+ powershell( script: "New-Item -ItemType Directory -Path ${platform}/build -Force", label: 'Create build directories' )
+ powershell( script: "tar -xf (Get-Item apache-couchdb-*.tar.gz) -C ${platform}/build --strip-components=1", label: 'Unpack release' )
+ dir( "${platform}/build" ) {
+ powershell( script: """
+ & ..\\..\\couchdb-glazier\\bin\\shell.ps1
+ & .\\configure.ps1 -SkipDeps -SpiderMonkeyVersion ${meta[platform].spidermonkey_vsn}
+ make -f Makefile.win
+ """, label: 'Configure and Build')
+ powershell( script: "& ..\\..\\couchdb-glazier\\bin\\shell.ps1; make -f Makefile.win eunit")
+ powershell( script: "& ..\\..\\couchdb-glazier\\bin\\shell.ps1; make -f Makefile.win elixir-suite")
+ powershell( script: "& ..\\..\\couchdb-glazier\\bin\\shell.ps1; make -f Makefile.win exunit")
+ powershell( script: "& ..\\..\\couchdb-glazier\\bin\\shell.ps1; make -f Makefile.win mango-test")
+ powershell( script: '& ..\\..\\couchdb-glazier\\bin\\shell.ps1; Write-Host "NOT AVAILABLE ATM: make -f Makefile.win weatherreport-test')
+ }
+ }
+ catch (err) {
+ powershell( script: "Get-ChildItem ${WORKSPACE}")
+ dir( "${platform}/build" ) {
+ powershell( script: 'Get-ChildItem')
+ powershell( script: '& ..\\..\\couchdb-glazier\\bin\\shell.ps1; make -f Makefile.win build-report')
+ powershell( script: 'Get-Content test-results.log')
+ }
+ error("Build step failed with error: ${err.getMessage()}")
+ }
+ finally {
+ //junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml'
+ //sh 'killall -9 beam.smp || true'
+ powershell( script: "Remove-Item ${WORKSPACE} -Force -Recurse -ErrorAction SilentlyContinue")
}
}
- error("Build step failed with error: ${err.getMessage()}")
- }
- finally {
- junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml'
- sh 'killall -9 beam.smp || true'
- sh 'rm -rf ${WORKSPACE}/*'
+
+ stage("${meta[platform].name} - package") {
+ echo "`nTODO - Build msi package"
+ }
}
}
}
@@ -309,59 +360,59 @@
}
}
- stage('Publish') {
-
- when {
- expression { return env.BRANCH_NAME ==~ /main|2.*.x|3.*.x|4.*.x|jenkins-.*/ }
- }
-
- agent {
- docker {
- image "apache/couchdbci-debian:bullseye-erlang-${ERLANG_VERSION}"
- label 'docker'
- args "${DOCKER_ARGS}"
- registryUrl 'https://docker.io/'
- registryCredentialsId 'dockerhub_creds'
- }
- }
- options {
- skipDefaultCheckout()
- timeout(time: 90, unit: "MINUTES")
- }
-
- steps {
- sh 'rm -rf ${WORKSPACE}/*'
- unstash 'tarball'
- unarchive mapping: ['pkgs/' : '.']
-
- sh( label: 'Build Debian repo', script: '''
- mkdir -p $BRANCH_NAME/debian $BRANCH_NAME/el7 $BRANCH_NAME/el8 $BRANCH_NAME/source
- git clone https://github.com/apache/couchdb-pkg
- for plat in buster bullseye focal
- do
- reprepro -b couchdb-pkg/repo includedeb $plat pkgs/$plat/*.deb
- done
- ''' )
-
- sh( label: 'Build CentOS repos', script: '''
- #cp js/centos-7/*rpm pkgs/centos7
- #cp js/centos-8/*rpm pkgs/centos8
- cd pkgs/centos7 && createrepo_c --database .
- cd ../centos8 && createrepo_c --database .
- ''' )
-
- sh( label: 'Build unified repo', script: '''
- mv couchdb-pkg/repo/pool $BRANCH_NAME/debian
- mv couchdb-pkg/repo/dists $BRANCH_NAME/debian
- mv pkgs/centos7/* $BRANCH_NAME/el7
- mv pkgs/centos8/* $BRANCH_NAME/el8
- mv apache-couchdb-*.tar.gz $BRANCH_NAME/source
- cd $BRANCH_NAME/source
- ls -1tr | head -n -10 | xargs -d '\n' rm -f --
- cd ../..
- ''' )
- } // steps
- } // stage
+ // stage('Publish') {
+ //
+ // when {
+ // expression { return env.BRANCH_NAME ==~ /main|2.*.x|3.*.x|4.*.x|jenkins-.*/ }
+ // }
+ //
+ // agent {
+ // docker {
+ // image "apache/couchdbci-debian:bullseye-erlang-${ERLANG_VERSION}"
+ // label 'docker'
+ // args "${DOCKER_ARGS}"
+ // registryUrl 'https://docker.io/'
+ // registryCredentialsId 'dockerhub_creds'
+ // }
+ // }
+ // options {
+ // skipDefaultCheckout()
+ // timeout(time: 90, unit: "MINUTES")
+ // }
+ //
+ // steps {
+ // sh 'rm -rf ${WORKSPACE}/*'
+ // unstash 'tarball'
+ // unarchive mapping: ['pkgs/' : '.']
+ //
+ // sh( label: 'Build Debian repo', script: '''
+ // mkdir -p $BRANCH_NAME/debian $BRANCH_NAME/el7 $BRANCH_NAME/el8 $BRANCH_NAME/source
+ // git clone https://github.com/apache/couchdb-pkg
+ // for plat in buster bullseye focal
+ // do
+ // reprepro -b couchdb-pkg/repo includedeb $plat pkgs/$plat/*.deb
+ // done
+ // ''' )
+ //
+ // sh( label: 'Build CentOS repos', script: '''
+ // #cp js/centos-7/*rpm pkgs/centos7
+ // #cp js/centos-8/*rpm pkgs/centos8
+ // cd pkgs/centos7 && createrepo_c --database .
+ // cd ../centos8 && createrepo_c --database .
+ // ''' )
+ //
+ // sh( label: 'Build unified repo', script: '''
+ // mv couchdb-pkg/repo/pool $BRANCH_NAME/debian
+ // mv couchdb-pkg/repo/dists $BRANCH_NAME/debian
+ // mv pkgs/centos7/* $BRANCH_NAME/el7
+ // mv pkgs/centos8/* $BRANCH_NAME/el8
+ // mv apache-couchdb-*.tar.gz $BRANCH_NAME/source
+ // cd $BRANCH_NAME/source
+ // ls -1tr | head -n -10 | xargs -d '\n' rm -f --
+ // cd ../..
+ // ''' )
+ // } // steps
+ // } // stage
} // stages
post {
diff --git a/build-aux/Jenkinsfile.pr b/build-aux/Jenkinsfile.pr
index cf97c90..5fbb451 100644
--- a/build-aux/Jenkinsfile.pr
+++ b/build-aux/Jenkinsfile.pr
@@ -96,193 +96,193 @@
}
}
} // 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 '''
- make python-black
- '''
- 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 && ./setup.sh ; make html)
- '''
- }
- post {
- cleanup {
- // UGH see https://issues.jenkins-ci.org/browse/JENKINS-41894
- sh 'rm -rf ${WORKSPACE}/*'
- }
- }
- } // stage Build Docs
-
- stage('Source Format Checks') {
- when {
- beforeOptions true
- expression { ONLY_DOCS_CHANGED == '0' }
- }
- 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 '''
- rm -rf apache-couchdb-*
- ./configure --skip-deps --spidermonkey-version 78
- make erlfmt-check
- make elixir-source-checks
- make python-black
- '''
- }
- post {
- cleanup {
- // UGH see https://issues.jenkins-ci.org/browse/JENKINS-41894
- sh 'rm -rf ${WORKSPACE}/*'
- }
- }
- } // stage Erlfmt
-
-
- stage('Make Dist') {
- when {
- beforeOptions true
- expression { ONLY_DOCS_CHANGED == '0' }
- }
- 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 '''
- rm -rf apache-couchdb-*
- ./configure --spidermonkey-version 78
- make dist
- chmod -R a+w * .
- '''
- }
- post {
- success {
- stash includes: 'apache-couchdb-*.tar.gz', name: 'tarball'
- }
- cleanup {
- // UGH see https://issues.jenkins-ci.org/browse/JENKINS-41894
- sh 'rm -rf ${WORKSPACE}/*'
- }
- }
- } // 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 {
- name 'ERLANG_VERSION'
- values '23.3.4.18', '24.3.4.7', '25.2'
- }
- axis {
- name 'SM_VSN'
- values '78'
- }
- }
-
- stages {
- stage('Build and Test') {
- agent {
- docker {
- image "${DOCKER_IMAGE_BASE}-${ERLANG_VERSION}"
- label 'docker'
- args "${DOCKER_ARGS}"
- }
- }
- options {
- skipDefaultCheckout()
- timeout(time: 90, unit: "MINUTES")
- }
- steps {
- unstash 'tarball'
- sh( script: build_and_test )
- }
- post {
- always {
- junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml'
- }
- cleanup {
- sh 'rm -rf ${WORKSPACE}/*'
- }
- }
- } // stage
- } // stages
- } // matrix
- } // stage "Make Check"
+//
+ // 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 '''
+ // make python-black
+ // '''
+ // 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 && ./setup.sh ; make html)
+ // '''
+ // }
+ // post {
+ // cleanup {
+ // // UGH see https://issues.jenkins-ci.org/browse/JENKINS-41894
+ // sh 'rm -rf ${WORKSPACE}/*'
+ // }
+ // }
+ // } // stage Build Docs
+//
+ // stage('Source Format Checks') {
+ // when {
+ // beforeOptions true
+ // expression { ONLY_DOCS_CHANGED == '0' }
+ // }
+ // 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 '''
+ // rm -rf apache-couchdb-*
+ // ./configure --skip-deps
+ // make erlfmt-check
+ // make elixir-source-checks
+ // make python-black
+ // '''
+ // }
+ // post {
+ // cleanup {
+ // // UGH see https://issues.jenkins-ci.org/browse/JENKINS-41894
+ // sh 'rm -rf ${WORKSPACE}/*'
+ // }
+ // }
+ // } // stage Erlfmt
+//
+//
+ // stage('Make Dist') {
+ // when {
+ // beforeOptions true
+ // expression { ONLY_DOCS_CHANGED == '0' }
+ // }
+ // 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 '''
+ // rm -rf apache-couchdb-*
+ // ./configure --spidermonkey-version 78
+ // make dist
+ // chmod -R a+w * .
+ // '''
+ // }
+ // post {
+ // success {
+ // stash includes: 'apache-couchdb-*.tar.gz', name: 'tarball'
+ // }
+ // cleanup {
+ // // UGH see https://issues.jenkins-ci.org/browse/JENKINS-41894
+ // sh 'rm -rf ${WORKSPACE}/*'
+ // }
+ // }
+ // } // 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 {
+ // name 'ERLANG_VERSION'
+ // values '23.3.4.18', '24.3.4.7', '25.2'
+ // }
+ // axis {
+ // name 'SM_VSN'
+ // values '78'
+ // }
+ // }
+//
+ // stages {
+ // stage('Build and Test') {
+ // agent {
+ // docker {
+ // image "${DOCKER_IMAGE_BASE}-${ERLANG_VERSION}"
+ // label 'docker'
+ // args "${DOCKER_ARGS}"
+ // }
+ // }
+ // options {
+ // skipDefaultCheckout()
+ // timeout(time: 90, unit: "MINUTES")
+ // }
+ // steps {
+ // unstash 'tarball'
+ // sh( script: build_and_test )
+ // }
+ // post {
+ // always {
+ // junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml'
+ // }
+ // cleanup {
+ // sh 'rm -rf ${WORKSPACE}/*'
+ // }
+ // }
+ // } // stage
+ // } // stages
+ // } // matrix
+ // } // stage "Make Check"
} // stages
} // pipeline