You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zr...@apache.org on 2018/12/14 08:24:36 UTC

[camel-website] branch jenkinsfile created (now 4987933)

This is an automated email from the ASF dual-hosted git repository.

zregvart pushed a change to branch jenkinsfile
in repository https://gitbox.apache.org/repos/asf/camel-website.git.


      at 4987933  Test preview

This branch includes the following new commits:

     new 4987933  Test preview

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[camel-website] 01/01: Test preview

Posted by zr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zregvart pushed a commit to branch jenkinsfile
in repository https://gitbox.apache.org/repos/asf/camel-website.git

commit 4987933318e16bc6f4b43b0f26bd242d20af43dd
Author: Zoran Regvart <zr...@apache.org>
AuthorDate: Fri Dec 14 09:24:18 2018 +0100

    Test preview
---
 Jenkinsfile | 116 +++++++++++++++++++++++++++++++++---------------------------
 1 file changed, 64 insertions(+), 52 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 5d17f54..fb1516d 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -21,66 +21,78 @@ def NODE_IMAGE = 'node:11'
 def YARN_OPTS = '--non-interactive --frozen-lockfile --json --cache-folder $WORKSPACE/.yarn --modules-folder node_modules'
 
 pipeline {
-    agent {
-        label "$NODE"
-    }
+  agent {
+    label "$NODE"
+  }
 
-    options {
-        buildDiscarder(
-            logRotator(artifactNumToKeepStr: '5', numToKeepStr: '10')
+  options {
+    buildDiscarder(
+        logRotator(artifactNumToKeepStr: '5', numToKeepStr: '10')
         )
-    }
+  }
 
-    stages {
-        stage('Build') {
-            agent {
-                docker {
-                    label "$NODE"
-                    image "$NODE_IMAGE"
-                    reuseNode true
-                }
-            }
+  stages {
+    stage('Build') {
+      agent {
+        docker {
+          label "$NODE"
+            image "$NODE_IMAGE"
+            reuseNode true
+        }
+      }
 
-            stages {
-                stage('Theme') {
-                    steps {
-                        sh "cd antora-ui-camel && yarn $YARN_OPTS install"
-                        sh "cd antora-ui-camel && yarn $YARN_OPTS gulp pack"
-                    }
-                }
+      stages {
+        stage('Theme') {
+          steps {
+            sh "cd antora-ui-camel && yarn $YARN_OPTS install"
+              sh "cd antora-ui-camel && yarn $YARN_OPTS gulp pack"
+          }
+        }
 
-                stage('Documentation') {
-                    steps {
-                        sh "yarn $YARN_OPTS install"
-                        sh "yarn $YARN_OPTS antora generate --cache-dir $WORKSPACE/.antora --clean --redirect-facility disabled site.yml"
-                    }
-                }
+        stage('Documentation') {
+          steps {
+            sh "yarn $YARN_OPTS install"
+              sh "yarn $YARN_OPTS antora generate --cache-dir $WORKSPACE/.antora --clean --redirect-facility disabled site.yml"
+          }
+        }
 
-                stage('Website') {
-                    steps {
-                        sh "yarn $YARN_OPTS install"
-                        sh "yarn $YARN_OPTS hugo"
-                    }
-                }
-            }
+        stage('Website') {
+          steps {
+            sh "yarn $YARN_OPTS install"
+              sh "yarn $YARN_OPTS hugo"
+          }
         }
+      }
+    }
 
-        stage('Deploy') {
-            when {
-                branch 'master'
-            }
+    stage('Deploy') {
+      when {
+        branch 'master'
+      }
+
+      steps {
+        dir('deploy/staging') {
+          deleteDir()
+            sh 'git clone -b asf-site https://gitbox.apache.org/repos/asf/camel-website.git .'
+            sh 'git rm -r *'
+            sh "cp -R $WORKSPACE/public/* ."
+            sh 'git add .'
+            sh 'git commit -m "Website updated to $(git rev-parse --short HEAD)"'
+            sh 'git push origin asf-site'
+        }
+      }
+    }
+
+    stage('Preview') {
+      when {
+        not {
+          branch 'master'
+        }
+      }
 
-            steps {
-                dir('deploy/staging') {
-                    deleteDir()
-                    sh 'git clone -b asf-site https://gitbox.apache.org/repos/asf/camel-website.git .'
-                    sh 'git rm -r *'
-                    sh "cp -R $WORKSPACE/public/* ."
-                    sh 'git add .'
-                    sh 'git commit -m "Website updated to $(git rev-parse --short HEAD)"'
-                    sh 'git push origin asf-site'
-                }
-            }
-       }
+      steps {
+        publishHTML([reportDir: 'public', reportFiles: 'index.html', reportName: 'Preview'])
+      }
     }
+  }
 }