This is an automated email from the ASF dual-hosted git repository. zregvart pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-website.git
commit 1cceb5e019550dd07c0414e7da4aee117859cec8 Author: Zoran Regvart <zregv...@apache.org> AuthorDate: Wed Dec 19 15:21:15 2018 +0100 CAMEL-11500: utilize caches and separate Theme ... ...and Website stages Make sure that caches are preserved between builds by checking out into a `camel-website` subdirectory and utilizing $WORKSPACE as $HOME for any cache folders. Also separates Theme and Website stages to make for a cleaner build by not invoking yarn from yarn. --- Jenkinsfile | 34 ++++++++++++++++++++++++++-------- package.json | 3 +-- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3a8d177..72de3be 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,10 +28,19 @@ 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" + HUGO_VERSION = "0.52.0" } stages { - stage('Build') { + stage('Theme') { agent { docker { label "$NODE" @@ -40,15 +49,24 @@ pipeline { } } - environment { - ANTORA_CACHE_DIR = "$WORKSPACE/.antora-cache" - YARN_CACHE_FOLDER = "$WORKSPACE/.yarn-cache" - HUGO_VERSION = "0.52.0" + 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 bundle" + } + } + + 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" } } @@ -62,7 +80,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 7dd039e..b046019 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,11 @@ "version": "1.0.0-SNAPSHOT", "license": "Apache-2.0", "scripts": { - "theme": "(cd antora-ui-camel && yarn install && yarn gulp bundle)", "documentation": "antora --clean --fetch 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",