Skip to content

Commit

Permalink
set up site-manifest in production build
Browse files Browse the repository at this point in the history
  • Loading branch information
djencks committed Dec 27, 2021
1 parent c5fe409 commit c018cf9
Show file tree
Hide file tree
Showing 10 changed files with 260 additions and 179 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ resources
!**/.yarn/versions
*.github-proxy.*

antora-playbook-*.yml

#temporary
local-antora-playbook-*
antora-playbook.yml
44 changes: 44 additions & 0 deletions antora-local-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/sh

#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

cd "$(dirname "${BASH_SOURCE[0]}")"

LOCAL=$1

if [ ! -d $LOCAL ]
then
echo Local project $LOCAL not found
exit
fi

antora-playbook-snippets/assemble-playbook.sh antora-playbook-local-full.yml ../$LOCAL/docs/source-map.yml playbook-export-site-manifest.yml

antora-playbook-snippets/assemble-playbook.sh antora-playbook-local-partial.yml ../$LOCAL/docs/source-map.yml ../$LOCAL/docs/source-watch.yml playbook-import-site-manifest-local.yml

antora-playbook-snippets/assemble-playbook.sh antora-playbook-local-quick.yml ../$LOCAL/docs/source-map.yml ../$LOCAL/docs/source-watch.yml playbook-import-site-manifest-remote.yml

if [ "$2" = "full" ]
then
yarn build:antora-local-full2
elif [ "$2" = "quick" ]
then
yarn build:antora-local-quick
else
yarn build:antora-local-partial2
fi
159 changes: 159 additions & 0 deletions antora-playbook-snippets/antora-playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
site:
title: Apache Camel
url: https://camel.apache.org
# start_page: _@manual::index.adoc

content:
sources:

- url: https://github.com/apache/camel.git
branches: main
start_paths:
# manual
- docs/user-manual

- url: https://github.com/apache/camel.git
branches:
- main
- camel-3.14.x
- camel-3.13.x
- camel-3.12.x
- camel-3.11.x
- camel-3.7.x
start_paths:
# eip
- core/camel-core-engine/src/main/docs
# main components doc
- docs/components

- url: https://github.com/apache/camel.git
branches: camel-2.x
start_paths:
# main components doc
- docs/components
# languages
- camel-core/src/main/docs

# sub-projects
- url: https://github.com/apache/camel-k.git
branches:
- main
- release-1.7.x
- release-1.6.x
- release-1.4.x
start_path: docs

- url: https://github.com/apache/camel-k-runtime.git
branches:
- main
- release-1.10.x
- release-1.9.x
start_path: docs

- url: https://github.com/apache/camel-kamelets.git
branches:
- main
- 0.5.x
start_path: docs

- url: https://github.com/apache/camel-quarkus.git
branches:
- main
- 2.6.x
- 2.5.x
- 2.4.x
start_path: docs

- url: https://github.com/apache/camel-quarkus-examples.git
branches: main
start_path: docs

- url: https://github.com/apache/camel-kafka-connector.git
branches:
- main
- camel-kafka-connector-0.11.x
start_paths:
- docs
- connectors

- url: https://github.com/apache/camel-spring-boot.git
branches:
- main
- camel-spring-boot-3.14.x
- camel-spring-boot-3.13.x
- camel-spring-boot-3.12.x
- camel-spring-boot-3.11.x
- camel-spring-boot-3.7.x
start_paths:
- components-starter
- core
- docs/components
- docs/spring-boot

- url: https://github.com/apache/camel-karaf.git
branches:
- main
- camel-karaf-3.14.x
- camel-karaf-3.13.x
- camel-karaf-3.12.x
- camel-karaf-3.11.x
- camel-karaf-3.7.x
start_path: docs

ui:
bundle:
url: ./antora-ui-camel/public/_

urls:
redirect_facility: httpd
latest_version_segment_strategy: redirect:from
latest_version_segment: latest


output:
dir: ./documentation

asciidoc:
attributes:
requires@: "'util=camel-website-util'"
# uncomment sb-statistics to see more info on camel spring boot list page such as non-spring-boot components.
# This also tests the output of unused camel-spring-boot json detection and fails the Antora build with errors.
# sb-statistics: on
extensions:
- ./extensions/table.js
- ./extensions/inline-styles.js

runtime:
log:
level: warn
failure_level: warn
# format: json

antora:
extensions:
- require: '@djencks/antora-aggregate-collector'
# log_level: trace
componentversions:
- name: components
version: '*'
local-mappings: ac-mappings.yml
- name: camel-spring-boot
version: '*'
local-mappings: ac-mappings.yml
- name: camel-kafka-connector
version: '*'
local-mappings: ac-mappings.yml

- require: '@djencks/asciidoctor-jsonpath'
# log_level: trace

- require: '@djencks/asciidoctor-antora-indexer'
# log_level: debug
requires: 'util=camel-website-util'
index_pages:
- local:
component: camel-kafka-connector
path: indexPages.yml
- local:
component: camel-kamelets
path: indexPages.yml
20 changes: 20 additions & 0 deletions antora-playbook-snippets/assemble-playbook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

cd `dirname $0`

if [ "../$1" = "../" ]
then
echo "Usage: ./antora-playbook-snippets/antora-playbook-assemble.sh <target playbook> [<playbook snippet>]+"
exit 1
fi

TARGET=../$1

cp antora-playbook.yml $TARGET

shift

for arg
do
cat $arg >> $TARGET
done
3 changes: 3 additions & 0 deletions antora-playbook-snippets/playbook-export-site-manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

- require: "@djencks/antora-site-manifest"
export-site-manifest: true
12 changes: 12 additions & 0 deletions antora-playbook-snippets/playbook-import-site-manifest-local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

- require: "@djencks/antora-site-manifest"
import_manifests:
- primary_site_manifest_url: ./documentation/site-manifest.json
local_urls: true
# Turn on partial_components if you further restict source-watch to build less than the full subproject.
# partial_components: true

- require: '@djencks/antora-timer'
log_level: info

generator: '@djencks/antora-source-watch'
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- require: "@djencks/antora-site-manifest"
import-manifests:
# Until PR is merged
- primary-site-manifest-url: https://pr-735--camel.netlify.app/site-manifest.json
# After PR is merged
# - primary-site-manifest-url: https://camel.apache.org/site-manifest.json

- require: '@djencks/antora-timer'
log_level: info
Loading

0 comments on commit c018cf9

Please sign in to comment.