From 8674524ab5eceeed4400137886c6c46f602d4266 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Mon, 8 Apr 2024 14:02:51 -0600 Subject: [PATCH 1/4] configure Antora Maven plugin to build site - change output directory from _site to target/site - add pom.xml with Antora Maven plugin - configure several executions of Antora Maven plugin - switch to using Maven to build site in CI --- .github/workflows/publish-site.yml | 7 ++-- .gitignore | 2 +- antora-playbook.yml | 29 +++++++++++------ pom.xml | 51 ++++++++++++++++++++++++++---- 4 files changed, 70 insertions(+), 19 deletions(-) diff --git a/.github/workflows/publish-site.yml b/.github/workflows/publish-site.yml index b4d6cb4..aeb3215 100644 --- a/.github/workflows/publish-site.yml +++ b/.github/workflows/publish-site.yml @@ -49,10 +49,13 @@ jobs: # must set ANTORA_CACHE_DIR so Maven will put jetty home where Antora Collector won't delete it ANTORA_CACHE_DIR: ${{ github.workspace }}/.cache/antora run: | - npm --audit false --fund false --omit optional --package-lock false i - npx --offline antora --stacktrace --extension @antora/collector-extension --extension @antora/lunr-extension --extension jetty-downloads-extension --html-url-extension-style indexify --log-failure-level error antora-playbook.yml + #npm --audit false --fund false --omit optional --package-lock false i + #npx --offline antora --stacktrace --extension @antora/collector-extension --extension @antora/lunr-extension --extension jetty-downloads --extension register-asciidoctor-kroki --html-url-extension-style indexify --log-failure-level error antora-playbook.yml + mvn antora:antora@full - name: Upload Artifact uses: actions/upload-pages-artifact@v3 + with: + path: target/site - name: Deploy Artifact to GitHub Pages id: deployment uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index bce537b..5290aae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /.cache/ -/_site/ /node_modules/ +/target/ /package-lock.json diff --git a/antora-playbook.yml b/antora-playbook.yml index 407bf43..9e88a97 100644 --- a/antora-playbook.yml +++ b/antora-playbook.yml @@ -1,26 +1,37 @@ # to build site quickly, run: # -# npx antora antora-playbook.yml +# mvn antora:antora +# +# which is equivalent to: +# +# npx antora --clean --fetch antora-playbook.yml # # to activate the diagram generator (Kroki), run: # -# npx --package antora --package asciidoctor-kroki antora antora-playbook.yml +# mvn antora:antora@kroki # -# to run the full production build, start by installing all the required dependencies: +# which is equivalent to: # -# npm i --package-lock false +# npx --package antora --package asciidoctor-kroki antora --extension register-asciidoctor-kroki antora-playbook.yml +# +# to run the full production build, run: # -# then run: +# mvn antora:antora@full # -# ANTORA_CACHE_DIR=$PWD/.cache/antora npx --offline antora --extension @antora/collector-extension --extension @antora/lunr-extension --extension jetty-downloads-extension antora-playbook.yml +# which is equivalent to: +# +# npm i --package-lock false +# ANTORA_CACHE_DIR=$PWD/.cache/antora npx --offline antora --clean --fetch --extension @antora/collector-extension --extension @antora/lunr-extension --extension jetty-downloads --extension register-asciidoctor-kroki --log-failure-level error --stacktrace antora-playbook.yml antora: extensions: - - ./lib/register-asciidoctor-kroki-extension.js - ./lib/component-url-prefix-extension.js - - id: jetty-downloads-extension + - id: jetty-downloads require: ./lib/jetty-downloads-extension.js enabled: false last_eol_version: 11 + - id: register-asciidoctor-kroki + require: ./lib/register-asciidoctor-kroki-extension.js + enabled: false site: title: Eclipse Jetty url: https://jetty.org @@ -48,4 +59,4 @@ ui: url: https://github.com/webtide/jetty.website/releases/download/ui-prod-latest/ui-bundle.zip snapshot: true output: - dir: ./_site + dir: target/site diff --git a/pom.xml b/pom.xml index ff02675..a152130 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 org.eclipse.jetty jetty-website @@ -9,12 +9,10 @@ Website for jetty.org https://jetty.org 1995 - Webtide https://webtide.com - Eclipse Public License - Version 2.0 @@ -25,18 +23,57 @@ https://www.apache.org/licenses/LICENSE-2.0 - - 1.0.0-SNAPSHOT + 1.0.0-alpha.2 - org.antora antora-maven-plugin ${antora.plugin.version} - true + + 18 + + + + + + + + cached + + + + + + + + kroki + + + + + + + + full + + + ${basedir}/.cache/antora + false + + + + + + + + + + + + From 15fe7164247a1de923cd916d995f0cd44045965a Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Mon, 8 Apr 2024 14:21:22 -0600 Subject: [PATCH 2/4] suppress transfer progress when running Maven in CI build [skip ci] --- .github/workflows/publish-site.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-site.yml b/.github/workflows/publish-site.yml index aeb3215..6aa96d5 100644 --- a/.github/workflows/publish-site.yml +++ b/.github/workflows/publish-site.yml @@ -51,7 +51,7 @@ jobs: run: | #npm --audit false --fund false --omit optional --package-lock false i #npx --offline antora --stacktrace --extension @antora/collector-extension --extension @antora/lunr-extension --extension jetty-downloads --extension register-asciidoctor-kroki --html-url-extension-style indexify --log-failure-level error antora-playbook.yml - mvn antora:antora@full + mvn -ntp antora:antora@full - name: Upload Artifact uses: actions/upload-pages-artifact@v3 with: From 9fdcac72e0e9b30358a5945b390974db785b6bf2 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Mon, 8 Apr 2024 14:25:00 -0600 Subject: [PATCH 3/4] set npm_config_audit environment variable in correct place --- .github/workflows/publish-site.yml | 9 +++++---- pom.xml | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-site.yml b/.github/workflows/publish-site.yml index 6aa96d5..4ef3ac1 100644 --- a/.github/workflows/publish-site.yml +++ b/.github/workflows/publish-site.yml @@ -48,10 +48,11 @@ jobs: env: # must set ANTORA_CACHE_DIR so Maven will put jetty home where Antora Collector won't delete it ANTORA_CACHE_DIR: ${{ github.workspace }}/.cache/antora - run: | - #npm --audit false --fund false --omit optional --package-lock false i - #npx --offline antora --stacktrace --extension @antora/collector-extension --extension @antora/lunr-extension --extension jetty-downloads --extension register-asciidoctor-kroki --html-url-extension-style indexify --log-failure-level error antora-playbook.yml - mvn -ntp antora:antora@full + npm_config_audit: false + #run: | + # npm --audit false --fund false --omit optional --package-lock false i + # npx --offline antora --stacktrace --extension @antora/collector-extension --extension @antora/lunr-extension --extension jetty-downloads --extension register-asciidoctor-kroki --html-url-extension-style indexify --log-failure-level error antora-playbook.yml + run: mvn -ntp antora:antora@full - name: Upload Artifact uses: actions/upload-pages-artifact@v3 with: diff --git a/pom.xml b/pom.xml index a152130..53d20cd 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,6 @@ ${basedir}/.cache/antora - false From 39832776aeec3f9e3f7f8301f70ecd2c8f1cf58a Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Tue, 9 Apr 2024 00:59:18 -0600 Subject: [PATCH 4/4] configure frontend-maven-plugin to build UI --- pom.xml | 2 +- ui/.npmrc | 1 + ui/README.adoc | 22 ++++++++++++++++ ui/pom.xml | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 ui/pom.xml diff --git a/pom.xml b/pom.xml index 53d20cd..ff8b241 100644 --- a/pom.xml +++ b/pom.xml @@ -25,6 +25,7 @@ 1.0.0-alpha.2 + 18.20.1 @@ -33,7 +34,6 @@ antora-maven-plugin ${antora.plugin.version} - 18 diff --git a/ui/.npmrc b/ui/.npmrc index 4eae787..cd6b3e0 100644 --- a/ui/.npmrc +++ b/ui/.npmrc @@ -1 +1,2 @@ +fund=false lockfile-version=3 diff --git a/ui/README.adoc b/ui/README.adoc index 2ab265c..cf4ce82 100644 --- a/ui/README.adoc +++ b/ui/README.adoc @@ -11,6 +11,28 @@ The UI bundle produced from this project is designed to be used with Antora. The bundle includes the HTML templates (layouts, partials, and helpers), CSS, JavaScript, fonts, and site-wide images. The rest of the material for the site is provided by various content repositories. +== Usage + +To bundle the UI with Maven, use: + + $ mvn process-resources + +On the first run, this command will also install Node.js and the project dependencies (npm packages). + +If you want to run a specific Gulp task, use: + + $ mvn process-resources -Dtask=preview + +If no task is specified, the default task (bundle) is run. + +To bypass the initialize step (after the first run) and run the Gulp task directly, use: + + $ mvn frontend:npx@gulp -Dtask=preview + +To print a list of available Gulp tasks, run: + + $ mvn frontend:npx@gulp -Dtask=--tasks + == Copyright and License === Software diff --git a/ui/pom.xml b/ui/pom.xml new file mode 100644 index 0000000..794b34d --- /dev/null +++ b/ui/pom.xml @@ -0,0 +1,69 @@ + + + 4.0.0 + org.eclipse.jetty + jetty-website-ui + 1.0.0-SNAPSHOT + pom + Jetty :: Project :: Website UI + UI for the Jetty website at jetty.org + https://jetty.org + 1995 + + Webtide + https://webtide.com + + + + Eclipse Public License - Version 2.0 + https://www.eclipse.org/legal/epl-2.0/ + + + + 1.15.0 + 18.20.1 + + + + + + com.github.eirslett + frontend-maven-plugin + ${frontend.plugin.version} + + ${basedir}/../target + v${node.version} + + + + install-node + + install-node-and-npm + + initialize + + + install-packages + + npm + + initialize + + ci + + + + gulp + + npx + + process-resources + + gulp --color ${task} + + + + + + +