bigbluebutton-Github/docs/build.sh

59 lines
1.3 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
set -eu
2023-01-13 04:46:18 +08:00
# Build the docs for these tags (the last tag of old major releases)
# We build the docs for historical reasons. The branch no longer exists
# since the release is no longer supported/maintained.
TAGS=(
2024-05-11 09:37:28 +08:00
v2.5.20
)
# Build the docs only for these release branches
BRANCHES=(
2024-05-11 09:37:28 +08:00
v2.6.x-release
2023-06-01 22:05:46 +08:00
v2.7.x-release
2023-12-08 04:36:11 +08:00
v3.0.x-release
)
REMOTE="origin"
git fetch --all
git fetch --tags
current_branch=$(git rev-parse --abbrev-ref HEAD)
for tag in "${TAGS[@]}"; do
2023-10-03 03:45:21 +08:00
if [ "$tag" != "$current_branch" ]; then
git fetch "$REMOTE" "$tag"
fi
git checkout "$tag"
if [ -f docusaurus.config.js ]; then
2023-10-03 03:45:21 +08:00
version=${tag:1:3}-legacy
echo "Adding documentation for $version"
2023-12-07 04:09:30 +08:00
npm run docusaurus docs:version "${version}"
else
2023-10-03 03:45:21 +08:00
echo "Warning: branch/tag $(version) does not contain a docusaurus.config.js!"
fi
done
for branch in "${BRANCHES[@]}"; do
if [ "$branch" != "$current_branch" ]; then
git fetch "$REMOTE" "$branch":"$branch"
fi
git checkout "$branch"
if [ -f docusaurus.config.js ]; then
version=${branch:1:3}
echo "Adding documentation for $version"
2023-12-07 04:09:30 +08:00
npm run docusaurus docs:version "${version}"
else
echo "Warning: branch $(branch) does not contain a docusaurus.config.js!"
fi
done
git checkout "$current_branch"