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 d7c3a6474f098cf779877fa3eefb08dfd640efc2
Author: Zoran Regvart <zregv...@apache.org>
AuthorDate: Sun Dec 16 14:33:20 2018 +0100

    CAMEL-11500: cleanup build
    
    This removes the invocation of yarn to build theme from yarn to build
    the website, it was too error prone. Also checkout is done in a
    workspace sub-directory so caches can be preserved at workspace level.
---
 Jenkinsfile  | 32 +++++++++++++++++++++++++-------
 package.json |  3 +--
 2 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index e76b562..fb00240 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -28,10 +28,18 @@ pipeline {
         buildDiscarder(
             logRotator(artifactNumToKeepStr: '5', numToKeepStr: '10')
         )
+
+        checkoutToSubdirectory('camel-website')
+    }
+
+    environment {
+        HOME = "$WORKSPACE"
+        ANTORA_CACHE_DIR  = "$WORKSPACE/.antora-cache"
+        YARN_CACHE_FOLDER = "$WORKSPACE/.yarn-cache"
     }
 
     stages {
-        stage('Build') {
+        stage('Theme') {
             agent {
                 docker {
                     label "$NODE"
@@ -40,14 +48,24 @@ pipeline {
                 }
             }
 
-            environment {
-                ANTORA_CACHE_DIR  = "$WORKSPACE/.antora-cache"
-                YARN_CACHE_FOLDER = "$WORKSPACE/.yarn-cache"
+            steps {
+                sh "cd $WORKSPACE/camel-website/antora-ui-camel && yarn 
--non-interactive --frozen-lockfile install"
+                sh "cd $WORKSPACE/camel-website/antora-ui-camel && yarn 
--non-interactive gulp pack"
+            }
+        }
+
+        stage('Website') {
+            agent {
+                docker {
+                    label "$NODE"
+                    image "$NODE_IMAGE"
+                    reuseNode true
+                }
             }
 
             steps {
-                sh "yarn --non-interactive --frozen-lockfile install"
-                sh "yarn --non-interactive build"
+                sh "cd $WORKSPACE/camel-website && yarn --non-interactive 
--frozen-lockfile install"
+                sh "cd $WORKSPACE/camel-website && yarn --non-interactive 
build"
             }
         }
 
@@ -61,7 +79,7 @@ pipeline {
                     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 "cp -R $WORKSPACE/camel-website/public/* ."
                     sh 'git add .'
                     sh 'git commit -m "Website updated to $(git rev-parse 
--short HEAD)"'
                     sh 'git push origin asf-site'
diff --git a/package.json b/package.json
index a564821..29978eb 100644
--- a/package.json
+++ b/package.json
@@ -1,11 +1,10 @@
 {
   "scripts": {
-    "theme": "(cd antora-ui-camel && yarn install && yarn gulp pack)",
     "documentation": "antora --pull site.yml",
     "website": "hugo --minify",
     "critical": "gulp critical",
     "minify": "gulp minify",
-    "build": "run-s theme documentation website minify critical"
+    "build": "run-s documentation website minify critical"
   },
   "devDependencies": {
     "@antora/cli": "^2.0.0-beta.1",

Reply via email to