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 3 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
25 changes: 23 additions & 2 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,31 @@ 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
cd docs
egrep -lRZ --exclude=CONTRIBUTING.md . | xargs -0 -l sed -i -e "s/replace-janssen-version/$VERSION/g"
Expand All @@ -111,6 +121,17 @@ jobs:
git push
cd ..
fi

echo "Generating javadocs"
if [ ! -z "$VERSION" ]; then
. ./automation/docs/generate-javadocs.sh
moabu marked this conversation as resolved.
Show resolved Hide resolved
cd docs
git add . || echo "Nothing to add"
git commit -a -S -m "docs: generate and add javadocs" || echo "Nothing to commit"
git push
moabu marked this conversation as resolved.
Show resolved Hide resolved
cd ..
fi
moabu marked this conversation as resolved.
Show resolved Hide resolved


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

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"
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