Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: host javadocs on GH #3377

Merged
merged 9 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,29 +88,50 @@ jobs:
continue-on-error: true
env:
VERSION: ${{ github.event.release.tag_name }}
JVM_PROJECTS: |
jans-auth-server
jans-orm
jans-config-api
jans-scim
jans-core
jans-notify
jans-fido2
jans-eleven
agama
run: |
echo "Custom work on generating docs can go here."

# Run cn docs
sudo bash ./automation/docs/generated-cn-docs.sh
moabu marked this conversation as resolved.
Show resolved Hide resolved

# Generate property docs and push to main
echo "Generating property docs and push to main"
sudo bash ./automation/docs/generate-property-docs.sh
cd docs
git add . || echo "Nothing to add"
git commit -a -S -m "docs: automated property doc generation" || echo "Nothing to commit"
git push
cd ..

# Replace release number markers with actual release number
echo "Replacing release number markers with actual release number"
if [ ! -z "$VERSION" ]; then
MVERSION="${VERSION:1}"
cd docs
egrep -lRZ --exclude=CONTRIBUTING.md . | xargs -0 -l sed -i -e "s/replace-janssen-version/$VERSION/g"
# strip v from v1.x.x
egrep -lRZ --exclude=CONTRIBUTING.md . | xargs -0 -l sed -i -e "s/replace-janssen-image-version/${VERSION:1}/g"
git add . || echo "Nothing to add"
git commit -a -S -m "docs: replace release marker with release number" || echo "Nothing to commit"
git push
cd ..
fi

echo "Generating javadocs"
sudo bash ./automation/docs/generate-javadocs.sh
cd docs
git add . || echo "Nothing to add"
git commit -a -S -m "docs: generate and add javadocs" || echo "Nothing to commit"
cd ..

git push


- name: mike deploy ${{ github.event.inputs.version }}
if: >-
Expand Down
22 changes: 22 additions & 0 deletions automation/docs/generate-javadocs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -euo pipefail

moabu marked this conversation as resolved.
Show resolved Hide resolved
for module in $JVM_PROJECTS
do
echo "Generating javadocs for module: $module and all it's sub-modules"
mvn -f "$module"/pom.xml javadoc:javadoc

echo "Move generated javadocs to respective doc site location"

echo "getting locations where javadocs got generated"
mapfile -t generated_doc_paths < <(find "$module" -type d -path '*/target/site/apidocs' | sed -r 's|/[^/]+$||' | sed -r 's|/[^/]+$||' | sed -r 's|/[^/]+$||')

echo "move javadocs from each location to respective documentation site location"
for source_path in "${generated_doc_paths[@]}"
do
# check if the directory `docs/admin/reference/javadocs/$source_path` exists, if not then create one
mkdir -p docs/admin/reference/javadocs/"$source_path"
echo "copy javadocs for $source_path"
cp -rv ./"$source_path"/target/site/apidocs/* ./docs/admin/reference/javadocs/"$source_path"/
done
done