This is an automated email from the ASF dual-hosted git repository. willholley pushed a commit to branch nodejs-10 in repository https://gitbox.apache.org/repos/asf/couchdb-fauxton.git
commit 09a78643d6762ed72e07bf88d5a6f6df88b8824c Author: Will Holley <[email protected]> AuthorDate: Mon Oct 14 09:37:24 2019 +0100 WIP Jenkinsfile --- Jenkinsfile | 290 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 290 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..efb4a5c --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,290 @@ +#!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. + +make_packages = ''' +npm install --production && ./node_modules/grunt-cli/bin/grunt couchdb +''' + +pipeline { + + // no top-level agent; agents must be declared for each stage + agent { + label 'ubuntu' + } + + environment { + recipient = '[email protected]' + } + + 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 { + parallel { + stage('FreeBSD') { + agent { + label 'couchdb && freebsd' + } + options { + skipDefaultCheckout() + timeout(time: 90, unit: "MINUTES") + } + steps { + // deleteDir is OK here because we're not inside of a Docker container! + deleteDir() + sh( script: make_packages ) + } // steps + } // stage FreeBSD + + stage('CentOS 6') { + agent { + docker { + image 'couchdbdev/centos-6-erlang-19.3.6:latest' + alwaysPull true + label 'ubuntu' + // this keeps builds landing on the same host from clashing with each other + customWorkspace pwd() + '/centos6' + } + } + options { + skipDefaultCheckout() + timeout(time: 90, unit: "MINUTES") + } + environment { + platform = 'centos6' + } + stages { + stage('Build') { + steps { + sh( script: make_packages ) + } + } + } // stages + post { + cleanup { + sh 'rm -rf ${WORKSPACE}/*' + } + } // post + } // stage + + stage('CentOS 7') { + agent { + docker { + image 'couchdbdev/centos-7-erlang-19.3.6:latest' + alwaysPull true + label 'ubuntu' + customWorkspace pwd() + '/centos7' + } + } + options { + skipDefaultCheckout() + timeout(time: 90, unit: "MINUTES") + } + environment { + platform = 'centos6' + } + stages { + stage('Build') { + steps { + sh( script: make_packages ) + } + } + } // stages + post { + cleanup { + sh 'rm -rf ${WORKSPACE}/*' + } + } // post + } // stage + + stage('Ubuntu Xenial') { + agent { + docker { + image 'couchdbdev/ubuntu-xenial-erlang-19.3.6:latest' + alwaysPull true + label 'ubuntu' + customWorkspace pwd() + '/xenial' + } + } + options { + skipDefaultCheckout() + timeout(time: 90, unit: "MINUTES") + } + environment { + platform = 'centos6' + } + stages { + stage('Build') { + steps { + sh( script: make_packages ) + } + } + } // stages + post { + cleanup { + sh 'rm -rf ${WORKSPACE}/*' + } + } // post + } // stage + + stage('Ubuntu Bionic') { + agent { + docker { + image 'couchdbdev/ubuntu-bionic-erlang-19.3.6:latest' + alwaysPull true + label 'ubuntu' + customWorkspace pwd() + '/bionic' + } + } + options { + skipDefaultCheckout() + timeout(time: 90, unit: "MINUTES") + } + environment { + platform = 'centos6' + } + stages { + stage('Build') { + steps { + sh( script: make_packages ) + } + } + } // stages + post { + cleanup { + sh 'rm -rf ${WORKSPACE}/*' + } + } // post + } // stage + + stage('Debian Jessie') { + agent { + docker { + image 'couchdbdev/debian-jessie-erlang-19.3.6:latest' + alwaysPull true + label 'ubuntu' + customWorkspace pwd() + '/jessie' + } + } + options { + skipDefaultCheckout() + timeout(time: 90, unit: "MINUTES") + } + environment { + platform = 'centos6' + } + stages { + stage('Build') { + steps { + sh( script: make_packages ) + } + } + } // stages + post { + cleanup { + sh 'rm -rf ${WORKSPACE}/*' + } + } // post + } // stage + + stage('Debian Stretch x86_64') { + agent { + docker { + image 'couchdbdev/debian-stretch-erlang-19.3.6:latest' + alwaysPull true + label 'ubuntu' + customWorkspace pwd() + '/stretch' + } + } + options { + skipDefaultCheckout() + timeout(time: 90, unit: "MINUTES") + } + environment { + platform = 'centos6' + } + stages { + stage('Build') { + steps { + sh( script: make_packages ) + } + } + } // stages + post { + cleanup { + sh 'rm -rf ${WORKSPACE}/*' + } + } // post + } // stage + + stage('Debian Stretch aarch64') { + agent { + docker { + image 'couchdbdev/aarch64-debian-stretch-erlang-20.3.8.20:latest' + alwaysPull true + label 'arm' + customWorkspace pwd() + '/arm' + } + } + options { + skipDefaultCheckout() + timeout(time: 90, unit: "MINUTES") + } + environment { + platform = 'centos6' + } + stages { + stage('Build') { + steps { + sh( script: make_packages ) + } + } + } // stages + post { + cleanup { + sh 'rm -rf ${WORKSPACE}/*' + } + } // post + } // stage + } // parallel + } // stages + + post { + success { + mail to: "${env.recipient}", + replyTo: "${env.recipient}", + subject: "[Jenkins] SUCCESS: ${currentBuild.fullDisplayName}", + body: "Yay, we passed. ${env.RUN_DISPLAY_URL}" + } + unstable { + mail to: "${env.recipient}", + replyTo: "${env.recipient}", + subject: "[Jenkins] SUCCESS: ${currentBuild.fullDisplayName}", + body: "Eep! Build is unstable... ${env.RUN_DISPLAY_URL}" + } + failure { + mail to: "${env.recipient}", + replyTo: "${env.recipient}", + subject: "[Jenkins] FAILURE: ${currentBuild.fullDisplayName}", + body: "Boo, we failed. ${env.RUN_DISPLAY_URL}" + } + } +} // pipeline
