Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2657F200CCA for ; Wed, 19 Jul 2017 23:53:46 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 232AD16A018; Wed, 19 Jul 2017 21:53:46 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E7B3A16A01A for ; Wed, 19 Jul 2017 23:53:44 +0200 (CEST) Received: (qmail 14045 invoked by uid 500); 19 Jul 2017 21:53:44 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 14036 invoked by uid 99); 19 Jul 2017 21:53:44 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jul 2017 21:53:44 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 5DCDE81573; Wed, 19 Jul 2017 21:53:41 +0000 (UTC) Date: Wed, 19 Jul 2017 21:53:42 +0000 To: "commits@couchdb.apache.org" Subject: [couchdb] 01/01: Build repos and push to couchdb-vm2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: wohali@apache.org Reply-To: "commits@couchdb.apache.org" In-Reply-To: <150050122145.10576.5432105470476921904@gitbox.apache.org> References: <150050122145.10576.5432105470476921904@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: couchdb X-Git-Refname: refs/heads/jenkins-packages-2 X-Git-Reftype: branch X-Git-Rev: fd3f586c87a97bbc8b6c63aad266586a52b05089 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20170719215342.5DCDE81573@gitbox.apache.org> archived-at: Wed, 19 Jul 2017 21:53:46 -0000 This is an automated email from the ASF dual-hosted git repository. wohali pushed a commit to branch jenkins-packages-2 in repository https://gitbox.apache.org/repos/asf/couchdb.git commit fd3f586c87a97bbc8b6c63aad266586a52b05089 Author: Joan Touzet AuthorDate: Wed Jul 19 03:42:39 2017 -0400 Build repos and push to couchdb-vm2 --- Jenkinsfile | 209 +++++++++++++++++++++++++++++------------------------------- 1 file changed, 102 insertions(+), 107 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 88401b8..f6779c5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,34 +31,40 @@ pipeline { image 'couchdbdev/ubuntu-14.04-erlang-default' // https://github.com/jenkins-infra/jenkins.io/blob/master/Jenkinsfile#64 // We need the jenkins user mapped inside of the image + // npm config cache below is required because /home/jenkins doesn't + // ACTUALLY exist in the image args '-e npm_config_cache=npm-cache -e HOME=. -v=/etc/passwd:/etc/passwd -v /etc/group:/etc/group' } } steps { timeout(time: 15, unit: "MINUTES") { - // npm config cache below is required because /home/jenkins doesn't - // ACTUALLY exist in the image sh ''' set - rm -rf apache-couchdb-*.tar.gz - #export npm_config_cache=$(mktemp -d) + rm -rf apache-couchdb-* ./configure --with-curl make dist - chmod -R a+w * + #chown -R jenkins:jenkins * || true ''' + } + } + post { + success { stash includes: 'apache-couchdb-*.tar.gz', name: 'tarball' archiveArtifacts artifacts: 'apache-couchdb-*.tar.gz', fingerprint: true deleteDir() } + failure { + deleteDir() + } } } // TODO rework this once JENKINS-41334 is released // https://issues.jenkins-ci.org/browse/JENKINS-41334 - // The builddir stuff is to prevent all 10 builds from live syncing - // their build results to each other during the build. Moving the - // build outside of the workdir should speed up the build process, too + // The builddir stuff is to prevent all the builds from live syncing + // their build results to each other during the build, which ACTUALLY + // HAPPENS. Ugh. // we run all package builds as root inside the Docker container @@ -68,41 +74,38 @@ pipeline { parallel(centos6erlang183: { node(label: 'ubuntu') { timeout(time: 60, unit: "MINUTES") { - unstash 'tarball' sh 'docker pull couchdbdev/centos-6-erlang-18.3' withDockerContainer(image: 'couchdbdev/centos-6-erlang-18.3', args: '-e LD_LIBRARY_PATH=/usr/local/bin -v=/etc/passwd:/etc/passwd -v /etc/group:/etc/group --user 0:0') { + sh 'rm -f apache-couchdb-*.tar.gz' + unstash 'tarball' sh ''' cwd=$(pwd) umask 0 - rm -rf /tmp/couchjslogs && mkdir -p /tmp/couchjslogs + mkdir -p $(COUCHDB_IO_LOG_DIR) # Build CouchDB from tarball builddir=$(mktemp -d) cd $builddir tar -xf $cwd/apache-couchdb-*.tar.gz cd apache-couchdb-* - ./configure --with-curl - make all + #./configure --with-curl + #make all #make check || (build-aux/logfile-uploader.py && false) # Build CouchDB packages cd $builddir git clone https://github.com/apache/couchdb-pkg mkdir couchdb - cd couchdb - cp $cwd/apache-couchdb-*.tar.gz . - tar -xf apache-couchdb-*.tar.gz - cd ../couchdb-pkg - # centos only + cp $cwd/apache-couchdb-*.tar.gz couchdb + tar -xf apache-couchdb-*.tar.gz -C couchdb + cd couchdb-pkg platform=centos6 make $platform PLATFORM=$platform + + # Cleanup & save for posterity rm -rf $cwd/pkgs/$platform && mkdir -p $cwd/pkgs/$platform - # CentOS variant mv ~/rpmbuild/RPMS/x86_64/*rpm $cwd/pkgs/$platform || true - - # Cleanup - cd $cwd && rm -rf $builddir - chown -R jenkins:jenkins * + chown -R jenkins:jenkins $cwd/* ''' } // withDocker } // timeout @@ -113,19 +116,21 @@ pipeline { centos7erlangdefault: { node(label: 'ubuntu') { timeout(time: 45, unit: "MINUTES") { - unstash 'tarball' sh 'docker pull couchdbdev/centos-7-erlang-default' withDockerContainer(image: 'couchdbdev/centos-7-erlang-default', args: '-e LD_LIBRARY_PATH=/usr/local/bin -e npm_config_cache=npm-cache -e HOME=. -v=/etc/passwd:/etc/passwd -v /etc/group:/etc/group') { + sh 'rm -f apache-couchdb-*.tar.gz' + unstash 'tarball' sh ''' cwd=$(pwd) - rm -rf /tmp/couchjslogs - mkdir -p /tmp/couchjslogs + mkdir -p $(COUCHDB_IO_LOG_DIR) + + # Build CouchDB from tarball builddir=$(mktemp -d) cd $builddir tar -xf $cwd/apache-couchdb-*.tar.gz cd apache-couchdb-* - ./configure --with-curl - make all + #./configure --with-curl + #make all #make check || (build-aux/logfile-uploader.py && false) ''' } // withDocker @@ -136,41 +141,38 @@ pipeline { centos7erlang183: { node(label: 'ubuntu') { timeout(time: 60, unit: "MINUTES") { - unstash 'tarball' sh 'docker pull couchdbdev/centos-7-erlang-18.3' withDockerContainer(image: 'couchdbdev/centos-7-erlang-18.3', args: '-e LD_LIBRARY_PATH=/usr/local/bin -v=/etc/passwd:/etc/passwd -v /etc/group:/etc/group --user 0:0') { + sh 'rm -f apache-couchdb-*.tar.gz' + unstash 'tarball' sh ''' cwd=$(pwd) umask 0 - rm -rf /tmp/couchjslogs && mkdir -p /tmp/couchjslogs + mkdir -p $(COUCHDB_IO_LOG_DIR) # Build CouchDB from tarball builddir=$(mktemp -d) cd $builddir tar -xf $cwd/apache-couchdb-*.tar.gz cd apache-couchdb-* - ./configure --with-curl - make all + #./configure --with-curl + #make all #make check || (build-aux/logfile-uploader.py && false) # Build CouchDB packages cd $builddir git clone https://github.com/apache/couchdb-pkg mkdir couchdb - cd couchdb - cp $cwd/apache-couchdb-*.tar.gz . - tar -xf apache-couchdb-*.tar.gz - cd ../couchdb-pkg - # centos only + cp $cwd/apache-couchdb-*.tar.gz couchdb + tar -xf apache-couchdb-*.tar.gz -C couchdb + cd couchdb-pkg platform=centos7 make $platform PLATFORM=$platform + + # Cleanup & save for posterity rm -rf $cwd/pkgs/$platform && mkdir -p $cwd/pkgs/$platform - # CentOS variant mv ~/rpmbuild/RPMS/x86_64/*rpm $cwd/pkgs/$platform || true - - # Cleanup - cd $cwd && rm -rf $builddir - chown -R jenkins:jenkins * + chown -R jenkins:jenkins $cwd/* ''' } // withDocker } // timeout @@ -181,19 +183,19 @@ pipeline { ubuntu1204erlang183: { node(label: 'ubuntu') { timeout(time: 45, unit: "MINUTES") { - unstash 'tarball' sh 'docker pull couchdbdev/ubuntu-12.04-erlang-18.3' withDockerContainer(image: 'couchdbdev/ubuntu-12.04-erlang-18.3', args: '-e npm_config_cache=npm-cache -e HOME=. -v=/etc/passwd:/etc/passwd -v /etc/group:/etc/group') { + sh 'rm -f apache-couchdb-*.tar.gz' + unstash 'tarball' sh ''' cwd=$(pwd) - rm -rf /tmp/couchjslogs - mkdir -p /tmp/couchjslogs + mkdir -p $(COUCHDB_IO_LOG_DIR) builddir=$(mktemp -d) cd $builddir tar -xf $cwd/apache-couchdb-*.tar.gz cd apache-couchdb-* - ./configure --with-curl - make all + #./configure --with-curl + #make all #make check || (build-aux/logfile-uploader.py && false) ''' } // withDocker @@ -204,19 +206,19 @@ pipeline { ubuntu1404erlangdefault: { node(label: 'ubuntu') { timeout(time: 45, unit: "MINUTES") { - unstash 'tarball' sh 'docker pull couchdbdev/ubuntu-14.04-erlang-default' withDockerContainer(image: 'couchdbdev/ubuntu-14.04-erlang-default', args: '-e npm_config_cache=npm-cache -e HOME=. -v=/etc/passwd:/etc/passwd -v /etc/group:/etc/group') { + sh 'rm -f apache-couchdb-*.tar.gz' + unstash 'tarball' sh ''' cwd=$(pwd) - rm -rf /tmp/couchjslogs - mkdir -p /tmp/couchjslogs + mkdir -p $(COUCHDB_IO_LOG_DIR) builddir=$(mktemp -d) cd $builddir tar -xf $cwd/apache-couchdb-*.tar.gz cd apache-couchdb-* - ./configure --with-curl - make all + #./configure --with-curl + #make all #make check || (build-aux/logfile-uploader.py && false) ''' } // withDocker @@ -227,42 +229,39 @@ pipeline { ubuntu1404erlang183: { node(label: 'ubuntu') { timeout(time: 60, unit: "MINUTES") { - unstash 'tarball' sh 'docker pull couchdbdev/ubuntu-14.04-erlang-18.3' withDockerContainer(image: 'couchdbdev/ubuntu-14.04-erlang-18.3', args: '-v=/etc/passwd:/etc/passwd -v /etc/group:/etc/group --user 0:0') { + sh 'rm -f apache-couchdb-*.tar.gz' + unstash 'tarball' sh ''' cwd=$(pwd) umask 0 - rm -rf /tmp/couchjslogs && mkdir -p /tmp/couchjslogs + mkdir -p $(COUCHDB_IO_LOG_DIR) # Build CouchDB from tarball builddir=$(mktemp -d) cd $builddir tar -xf $cwd/apache-couchdb-*.tar.gz cd apache-couchdb-* - ./configure --with-curl - make all + #./configure --with-curl + #make all #make check || (build-aux/logfile-uploader.py && false) # Build CouchDB packages cd $builddir git clone https://github.com/apache/couchdb-pkg mkdir couchdb - cd couchdb - cp $cwd/apache-couchdb-*.tar.gz . - tar -xf apache-couchdb-*.tar.gz - cd ../couchdb-pkg - # debian/ubuntu only + cp $cwd/apache-couchdb-*.tar.gz couchdb + tar -xf apache-couchdb-*.tar.gz -C couchdb + cd couchdb-pkg sudo apt-get install -y libmozjs185-dev platform=$(lsb_release -cs) make $platform PLATFORM=$platform + + # Cleanup & save for posterity rm -rf $cwd/pkgs/$platform && mkdir -p $cwd/pkgs/$platform - # Ubuntu/Debian variant mv ../couchdb/*deb $cwd/pkgs/$platform || true - - # Cleanup - cd $cwd && rm -rf $builddir - chown -R jenkins:jenkins * + chown -R jenkins:jenkins $cwd/* ''' } // withDocker } // timeout @@ -273,19 +272,19 @@ pipeline { ubuntu1604erlangdefault: { node(label: 'ubuntu') { timeout(time: 45, unit: "MINUTES") { - unstash 'tarball' sh 'docker pull couchdbdev/ubuntu-16.04-erlang-default' withDockerContainer(image: 'couchdbdev/ubuntu-16.04-erlang-default', args: '-e npm_config_cache=npm-cache -e HOME=. -v=/etc/passwd:/etc/passwd -v /etc/group:/etc/group') { + sh 'rm -f apache-couchdb-*.tar.gz' + unstash 'tarball' sh ''' cwd=$(pwd) - rm -rf /tmp/couchjslogs - mkdir -p /tmp/couchjslogs + mkdir -p $(COUCHDB_IO_LOG_DIR) builddir=$(mktemp -d) cd $builddir tar -xf $cwd/apache-couchdb-*.tar.gz cd apache-couchdb-* - ./configure --with-curl - make all + #./configure --with-curl + #make all #make check || (build-aux/logfile-uploader.py && false) ''' } // withDocker @@ -296,42 +295,39 @@ pipeline { ubuntu1604erlang183: { node(label: 'ubuntu') { timeout(time: 60, unit: "MINUTES") { - unstash 'tarball' sh 'docker pull couchdbdev/ubuntu-16.04-erlang-18.3' withDockerContainer(image: 'couchdbdev/ubuntu-16.04-erlang-18.3', args: '-v=/etc/passwd:/etc/passwd -v /etc/group:/etc/group --user 0:0') { + sh 'rm -f apache-couchdb-*.tar.gz' + unstash 'tarball' sh ''' cwd=$(pwd) umask 0 - rm -rf /tmp/couchjslogs && mkdir -p /tmp/couchjslogs + mkdir -p $(COUCHDB_IO_LOG_DIR) # Build CouchDB from tarball builddir=$(mktemp -d) cd $builddir tar -xf $cwd/apache-couchdb-*.tar.gz cd apache-couchdb-* - ./configure --with-curl - make all + #./configure --with-curl + #make all #make check || (build-aux/logfile-uploader.py && false) # Build CouchDB packages cd $builddir git clone https://github.com/apache/couchdb-pkg mkdir couchdb - cd couchdb - cp $cwd/apache-couchdb-*.tar.gz . - tar -xf apache-couchdb-*.tar.gz - cd ../couchdb-pkg - # debian/ubuntu only + cp $cwd/apache-couchdb-*.tar.gz couchdb + tar -xf apache-couchdb-*.tar.gz -C couchdb + cd couchdb-pkg sudo apt-get install -y libmozjs185-dev platform=$(lsb_release -cs) make $platform PLATFORM=$platform + + # Cleanup & save for posterity rm -rf $cwd/pkgs/$platform && mkdir -p $cwd/pkgs/$platform - # Ubuntu/Debian variant mv ../couchdb/*deb $cwd/pkgs/$platform || true - - # Cleanup - cd $cwd && rm -rf $builddir - chown -R jenkins:jenkins * + chown -R jenkins:jenkins $cwd/* ''' } // withDocker } // timeout @@ -342,19 +338,19 @@ pipeline { debian8erlangdefault: { node(label: 'ubuntu') { timeout(time: 45, unit: "MINUTES") { - unstash 'tarball' sh 'docker pull couchdbdev/debian-8-erlang-default' withDockerContainer(image: 'couchdbdev/debian-8-erlang-default', args: '-e npm_config_cache=npm-cache -e HOME=. -v=/etc/passwd:/etc/passwd -v /etc/group:/etc/group') { + sh 'rm -f apache-couchdb-*.tar.gz' + unstash 'tarball' sh ''' cwd=$(pwd) - rm -rf /tmp/couchjslogs - mkdir -p /tmp/couchjslogs + mkdir -p $(COUCHDB_IO_LOG_DIR) builddir=$(mktemp -d) cd $builddir tar -xf $cwd/apache-couchdb-*.tar.gz cd apache-couchdb-* - ./configure --with-curl - make all + #./configure --with-curl + #make all #make check || (build-aux/logfile-uploader.py && false) ''' } // withDocker @@ -365,42 +361,39 @@ pipeline { debian8erlang183: { node(label: 'ubuntu') { timeout(time: 60, unit: "MINUTES") { - unstash 'tarball' sh 'docker pull couchdbdev/debian-8-erlang-18.3' // must run as root because of sudo step below withDockerContainer(image: 'couchdbdev/debian-8-erlang-18.3', args: '-v=/etc/passwd:/etc/passwd -v /etc/group:/etc/group --user 0:0') { + sh 'rm -f apache-couchdb-*.tar.gz' + unstash 'tarball' sh ''' cwd=$(pwd) - rm -rf /tmp/couchjslogs && mkdir -p /tmp/couchjslogs + mkdir -p $(COUCHDB_IO_LOG_DIR) # Build CouchDB from tarball builddir=$(mktemp -d) cd $builddir tar -xf $cwd/apache-couchdb-*.tar.gz cd apache-couchdb-* - ./configure --with-curl - make all + #./configure --with-curl + #make all #make check || (build-aux/logfile-uploader.py && false) # Build CouchDB packages cd $builddir git clone https://github.com/apache/couchdb-pkg mkdir couchdb - cd couchdb - cp $cwd/apache-couchdb-*.tar.gz . - tar -xf apache-couchdb-*.tar.gz - cd ../couchdb-pkg - # debian/ubuntu only + cp $cwd/apache-couchdb-*.tar.gz couchdb + tar -xf apache-couchdb-*.tar.gz -C couchdb + cd couchdb-pkg sudo apt-get install -y libmozjs185-dev platform=$(lsb_release -cs) make $platform PLATFORM=$platform + + # Cleanup & save for posterity rm -rf $cwd/pkgs/$platform && mkdir -p $cwd/pkgs/$platform - # Ubuntu/Debian variant mv ../couchdb/*deb $cwd/pkgs/$platform || true - - # Cleanup - cd $cwd && rm -rf $builddir - chown -R jenkins:jenkins * + chown -R jenkins:jenkins $cwd/* ''' } // withDocker } // timeout @@ -421,13 +414,14 @@ pipeline { // This image has the deb AND rpm repo tools installed in it image 'couchdbdev/debian-8-base' // We need the jenkins user mapped inside of the image + // We must run as root because we have to create ~/.ssh for rsync args '-v /etc/passwd:/etc/passwd -v /etc/group:/etc/group' label 'ubuntu' } } steps { withCredentials([file(credentialsId: 'jenkins-key', variable: 'KEY')]) { - sh 'rm -rf pkgs' + sh 'rm -rf pkgs *.tar.gz' unarchive mapping: ['pkgs/' : '.'] echo 'Building Debian repo...' sh ''' @@ -439,7 +433,7 @@ pipeline { echo 'Building CentOS repos...' sh ''' cd pkgs/centos6 && createrepo --database . - cd ../centos7 && rm js* && createrepo --database . + cd ../centos7 && rm -f js* && createrepo --database . ''' echo 'rsyncing repos to couchdb-vm2...' sh ''' @@ -448,7 +442,7 @@ pipeline { mv couchdb-pkg/repo/dists $BRANCH_NAME/debian mv pkgs/centos6/* $BRANCH_NAME/el6 mv pkgs/centos7/* $BRANCH_NAME/el7 - rsync -avz --delete -e "ssh -i $KEY" $BRANCH_NAME username@couchdb-vm2.apache.org:/var/www/html + rsync -avz --delete -e "ssh -o StrictHostKeyChecking=no -i $KEY" $BRANCH_NAME jenkins@couchdb-vm2.apache.org:/var/www/html ''' // cronjob on couchdb-vm2 cleans up old tarballs (keeps latest 10) echo 'rsyncing source tarball to couchdb-vm2...' @@ -457,7 +451,8 @@ pipeline { rm -rf $BRANCH_NAME mkdir -p $BRANCH_NAME/source mv apache-couchdb-*.tar.gz $BRANCH_NAME/source - rsync -avz -e "ssh -i $KEY" $BRANCH_NAME username@couchdb-vm2.apache.org:/var/www/html + rsync -avz -e "ssh -o StrictHostKeyChecking=no -i $KEY" $BRANCH_NAME jenkins@couchdb-vm2.apache.org:/var/www/html + rm -rf $BRANCH_NAME couchdb-pkg *.tar.gz ''' deleteDir() } // withCredentials -- To stop receiving notification emails like this one, please contact "commits@couchdb.apache.org" .