Skip to content

Commit 5950906

Browse files
rwinchjzheaux
authored andcommitted
Copy default antora files
Closes gh-869
1 parent 104c879 commit 5950906

File tree

4 files changed

+115
-19
lines changed

4 files changed

+115
-19
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy Docs
2+
on:
3+
push:
4+
branches-ignore: [ gh-pages ]
5+
tags: '**'
6+
repository_dispatch:
7+
types: request-build-reference # legacy
8+
#schedule:
9+
#- cron: '0 10 * * *' # Once per day at 10am UTC
10+
workflow_dispatch:
11+
permissions:
12+
actions: write
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
# FIXME enable when pushed to spring-projects
17+
# if: github.repository_owner == 'spring-projects'
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
with:
22+
ref: docs-build
23+
fetch-depth: 1
24+
- name: Dispatch (partial build)
25+
if: github.ref_type == 'branch'
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }}
29+
- name: Dispatch (full build)
30+
if: github.ref_type == 'tag'
31+
env:
32+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD)

antora.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: ldap
2+
version: true
3+
title: Spring LDAP
4+
nav:
5+
- modules/ROOT/nav.adoc
6+
ext:
7+
collector:
8+
run:
9+
command: gradlew -q -PbuildSrc.skipTests=true "-Dorg.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError" generateAntoraYml
10+
local: true
11+
scan:
12+
dir: ./build/generated-antora-resources
13+
14+
asciidoc:
15+
attributes:
16+
attribute-missing: 'warn'
17+
# FIXME: the copyright is not removed
18+
# FIXME: The package is not renamed
19+
chomp: 'all'

build.gradle

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ buildscript {
1313
}
1414
}
1515

16+
plugins {
17+
id 'io.spring.antora.generate-antora-yml' version '0.0.1'
18+
id 'org.antora' version '1.0.0'
19+
}
20+
1621
apply plugin: 'io.spring.convention.root'
1722
apply plugin: 'io.spring.convention.docs'
1823
apply plugin: 'io.spring.javaformat'
@@ -33,24 +38,16 @@ nohttp {
3338
source.exclude "buildSrc/build/**"
3439
}
3540

36-
asciidoctor {
37-
outputDir = new File("$buildDir/docs")
38-
attributes([
39-
copycss : '',
40-
icons : 'font',
41-
'source-highlighter': 'prettify',
42-
sectanchors : '',
43-
toc2: '',
44-
idprefix: '',
45-
idseparator: '-',
46-
doctype: 'book',
47-
numbered: '',
48-
'spring-ldap-version' : project.version,
49-
revnumber : project.version
50-
])
51-
options = [
52-
eruby: 'erubis'
53-
]
41+
42+
antora {
43+
playbook = 'cached-antora-playbook.yml'
44+
playbookProvider {
45+
repository = 'spring-projects/spring-ldap'
46+
branch = 'docs-build'
47+
path = 'lib/antora/templates/per-branch-antora-playbook.yml'
48+
checkLocalBranch = true
49+
}
50+
options = [clean: true, fetch: !project.gradle.startParameter.offline, stacktrace: true]
5451
}
5552

5653
springRelease {
@@ -63,6 +60,14 @@ springRelease {
6360
replaceSnapshotVersionInReferenceDocUrl = true
6461
}
6562

63+
64+
tasks.named("generateAntoraYml") {
65+
asciidocAttributes = project.provider( {
66+
return ['project-version': project.version]
67+
} )
68+
}
69+
70+
6671
s101 {
6772
configurationDirectory = project.file("etc/s101")
6873
}
@@ -71,7 +76,7 @@ allprojects {
7176
if (!['spring-ldap-bom', 'spring-security-docs'].contains(project.name)) {
7277
apply plugin: 'io.spring.javaformat'
7378
apply plugin: 'checkstyle'
74-
79+
7580
pluginManager.withPlugin("io.spring.convention.checkstyle", { plugin ->
7681
configure(plugin) {
7782
dependencies {

cached-antora-playbook.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# PACKAGES [email protected] @antora/atlas-extension:1.0.0-alpha.1 @antora/[email protected] @springio/[email protected] @asciidoctor/[email protected] @springio/asciidoctor-extensions @opendevise/[email protected]
2+
#
3+
# The purpose of this Antora playbook is to build the docs in the current branch.
4+
antora:
5+
extensions:
6+
- '@antora/collector-extension'
7+
- id: '@antora/atlas-extension'
8+
require: '@antora/atlas-extension'
9+
enabled: false
10+
- '@springio/antora-extensions/latest-version-extension'
11+
- require: '@springio/antora-extensions/root-component-extension'
12+
root_component_name: 'ldap'
13+
site:
14+
title: Spring LDAP Reference
15+
content:
16+
sources:
17+
- url: .
18+
branches: HEAD
19+
worktrees: true
20+
asciidoc:
21+
attributes:
22+
hide-uri-scheme: '@'
23+
page-pagination: ''
24+
primary-site-url: https://docs.spring.io/spring-ldap/reference
25+
tabs-sync-option: '@'
26+
extensions:
27+
- '@asciidoctor/tabs'
28+
- '@springio/asciidoctor-extensions'
29+
- '@springio/asciidoctor-extensions/include-code-extension'
30+
sourcemap: true
31+
urls:
32+
latest_version_segment: ''
33+
runtime:
34+
log:
35+
failure_level: warn
36+
ui:
37+
bundle:
38+
url: https://github.com/spring-io/antora-ui-spring/releases/download/latest/ui-bundle.zip
39+
snapshot: true

0 commit comments

Comments
 (0)