couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woh...@apache.org
Subject [couchdb] 01/01: Build repos and push to couchdb-vm2
Date Wed, 19 Jul 2017 19:36:34 GMT
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 9da8505b633f32d7fc5c5fe9fd99938d417d18bc
Author: Joan Touzet <joant@atypical.net>
AuthorDate: Wed Jul 19 03:42:39 2017 -0400

    Build repos and push to couchdb-vm2
---
 Jenkinsfile | 46 ++++++++++++++++++++++++++++++----------------
 1 file changed, 30 insertions(+), 16 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 88401b8..1590502 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -44,7 +44,7 @@ pipeline {
             #export npm_config_cache=$(mktemp -d)
             ./configure --with-curl
             make dist
-            chmod -R a+w *
+            chmod -R a+w * || true
           '''
           stash includes: 'apache-couchdb-*.tar.gz', name: 'tarball'
           archiveArtifacts artifacts: 'apache-couchdb-*.tar.gz', fingerprint: true
@@ -68,9 +68,10 @@ 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
@@ -113,10 +114,11 @@ 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 '''
+                  sh 'rm -f apache-couchdb-*.tar.gz'
+                  unstash 'tarball'
                   cwd=$(pwd)
                   rm -rf /tmp/couchjslogs
                   mkdir -p /tmp/couchjslogs
@@ -136,9 +138,10 @@ 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
@@ -181,9 +184,10 @@ 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
@@ -204,9 +208,10 @@ 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
@@ -227,9 +232,10 @@ 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
@@ -273,9 +279,10 @@ 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
@@ -296,9 +303,10 @@ 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
@@ -342,9 +350,10 @@ 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
@@ -365,10 +374,11 @@ 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
@@ -421,13 +431,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
-          args '-v /etc/passwd:/etc/passwd -v /etc/group:/etc/group'
+          // We must run as root because we have to create ~/.ssh for rsync
+          args '-v /etc/passwd:/etc/passwd -v /etc/group:/etc/group --user 0:0'
           label 'ubuntu'
         }
       }
       steps {
         withCredentials([file(credentialsId: 'jenkins-key', variable: 'KEY')]) {
-          sh 'rm -rf pkgs'
+          sh 'umask 0 && rm -rf pkgs'
           unarchive mapping: ['pkgs/' : '.']
           echo 'Building Debian repo...'
           sh '''
@@ -439,7 +450,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,16 +459,19 @@ 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
username@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...'
+          sh 'rm -rf *.tar.gz'
           unstash 'tarball'
           sh '''
             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 username@couchdb-vm2.apache.org:/var/www/html
+            rm -rf $BRANCH_NAME couchdb-pkg *.tar.gz
+            chmod -R a+w * .
           '''
           deleteDir()
         } // withCredentials

-- 
To stop receiving notification emails like this one, please contact
"commits@couchdb.apache.org" <commits@couchdb.apache.org>.

Mime
View raw message