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 037815164621f210bece0b0aff714f1db6e0d752 Author: Zoran Regvart <[email protected]> AuthorDate: Thu Oct 29 16:07:37 2020 +0100 CAMEL-14682: single script to build theme and site When building `yarn build-all` should build both the theme and the website. It is no longer necessary to build the theme and then the website. This might help as the version that's run by default (1.17.0) doesn't seem to bootstrap the 2.3.3 version defined by .yarnrc.yml. --- Jenkinsfile | 21 +-------------------- README.md | 42 +++++++++++++++++++++++------------------- netlify.toml | 4 ++-- package.json | 1 + 4 files changed, 27 insertions(+), 41 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 088c106..e8d3ca8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,25 +40,6 @@ pipeline { } stages { - stage('Theme') { - agent { - dockerfile { - dir 'camel-website' - label "$NODE" - reuseNode true - args '-u root' - } - } - - environment { - HOME = "$WORKSPACE" - } - - steps { - sh "cd $WORKSPACE/camel-website/antora-ui-camel && yarn build" - } - } - stage('Website') { agent { dockerfile { @@ -74,7 +55,7 @@ pipeline { } steps { - sh "cd $WORKSPACE/camel-website && yarn build" + sh "cd $WORKSPACE/camel-website && yarn build-all" } } diff --git a/README.md b/README.md index 656e887..55b3f71 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Make sure that you have Node.js (herein "`Node`") installed. If this command fails with an error, you do not have Node installed. -This project requires the Node LTS version 10 (e.g., v10.15.3). +This project requires the Node LTS version 14 (e.g., v14.15.0). Please make sure to have a suitable version of Node installed. You have several options to install Node on your machine. @@ -67,35 +67,35 @@ Node on your machine. - Install using [Homebrew](https://brew.sh/) and [Node formulae](https://formulae.brew.sh/formula/node) - Install from official [Node packages](https://nodejs.org/en/download/) -An easy step to step guide to install nvm and install node v10.0.0 on your local system is as follows: +An easy step to step guide to install nvm and install node v14 on your local system is as follows: $ touch ~/.bash_profile - $ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash + $ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.36.0/install.sh | bash $ source ~/.nvm/nvm.sh - $ nvm install 10.0.0 + $ nvm install 14 -Note - If you have different Node version other than Node LTS version 10 you can use following command to make -Node LTS version 10 as default Node version. +Note - If you have different Node version other than Node LTS version 14 you can use following command to make +Node LTS version 14 as default Node version. - $ nvm use 10.0.0 + $ nvm use 14 ### Installation of nvm on Windows Note - The following steps need to be ran on cmd as administrator only. -An easy step to step guide to install nvm and install node v10.0.0 on your local system is as follows: +An easy step to step guide to install nvm and install node v14 on your local system is as follows: > choco install nvm - > nvm install 10.0.0 + > nvm install 14 -Note - If you have different Node version other than Node LTS version 10 you can use following command to make -Node LTS version 10 as default Node version. +Note - If you have different Node version other than Node LTS version 14 you can use following command to make +Node LTS version 14 as default Node version. - > nvm use 10.0.0 + > nvm use 14 -Now that you have Node 10 installed, you can proceed with checking the Yarn installation. +Now that you have Node 14 installed, you can proceed with checking the Yarn installation. #### Yarn @@ -112,20 +112,25 @@ Clone the Apache Camel Website project using git: The command above clones the Apache Camel Website project. After that you can switch to the new project directory on your filesystem. +## Build the website and Antora theme + +We're using yarn [workspaces](https://yarnpkg.com/features/workspaces) to build both the theme and the website run `build-all` script, for example: + + $ yarn build-all + +That will build the Antora theme (from antora-ui-camel directory) and the website. Result of the build can be seen in the `public` directory. + ## Build the Antora Camel UI theme -First step is to build the Antora ui theme used for the Apache Camel website. The theme sources are located -inside [Project root directory/antora-ui-camel](antora-ui-camel). So first switch to that directory: +The theme sources are located inside [Project root directory/antora-ui-camel](antora-ui-camel). So first switch to that directory: $ cd antora-ui-camel In that directory execute: - $ yarn install # needed only once, or if dependencies change - $ yarn format # to format the code $ yarn build # to perform the ui theme build -You should see the Antora theme bundle generated in in [antora-ui-camel/build/ui-bundle.zip](antora-ui-camel). +You should see the Antora theme bundle generated in in `antora-ui-camel/build/ui-bundle.zip`. In case `yarn build` raises error, run `yarn format` to format the code and re-run `yarn build` to build your bundle successfully. @@ -139,7 +144,6 @@ the theme bundle exists in [antora-ui-camel/build/ui-bundle.zip](antora-ui-camel To build the website go to the project root directory and run: - $ yarn install # needed only once, or if dependencies change $ yarn build # to perform the build diff --git a/netlify.toml b/netlify.toml index 4fc532f..4aa038d 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,6 +1,6 @@ [build] - command = "(cd antora-ui-camel && yarn --non-interactive --frozen-lockfile install && yarn --non-interactive --frozen-lockfile build) && yarn --non-interactive --frozen-lockfile install && yarn --non-interactive --frozen-lockfile build" - environment = { CAMEL_ENV = "netlify" } + command = "yarn build-all" + environment = { CAMEL_ENV = "netlify", YARN_VERSION = "1.22.5" } [build.processing] skip_processing = false diff --git a/package.json b/package.json index 508aebb..9ce68ed 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "build:minify": "gulp minify", "build:sitemap": "gulp sitemap", "build": "run-s build:antora build:hugo build:sitemap build:minify", + "build-all": "yarn workspaces foreach --topological-dev run build", "preview": "run-s preview:antora preview:hugo", "preview:antora": "antora --clean --fetch antora-playbook.yml", "preview:hugo": "hugo server -D",
