Skip to content

Commit 4aad45c

Browse files
authored
update docs generation script to work better with selinux (#121)
motivation: docs scripts is broken on selinux due to restriction on ssh-agent changes: change the jazzy worksapce to a directory accessible by the CI node so we can push from the agent instead of from the docker container
1 parent 1b5f8a5 commit 4aad45c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

scripts/generate_docs.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
##
1414
##===----------------------------------------------------------------------===##
1515

16-
set -e
16+
set -ex
1717

1818
my_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1919
root_path="$my_path/.."
@@ -71,23 +71,26 @@ which you can use to emit log messages.
7171
7272
EOF
7373

74-
tmp=`mktemp -d`
74+
jazzy_dir="$root_path/.build/jazzy"
75+
rm -rf "$jazzy_dir"
76+
mkdir -p "$jazzy_dir"
77+
7578
for module in "${modules[@]}"; do
76-
args=("${jazzy_args[@]}" --output "$tmp/docs/$version/$module" --docset-path "$tmp/docset/$version/$module" --module "$module")
79+
args=("${jazzy_args[@]}" --output "$jazzy_dir/docs/$version/$module" --docset-path "$jazzy_dir/docset/$version/$module" --module "$module")
7780
if [[ -f "$root_path/.build/sourcekitten/$module.json" ]]; then
7881
args+=(--sourcekitten-sourcefile "$root_path/.build/sourcekitten/$module.json")
7982
fi
8083
jazzy "${args[@]}"
8184
done
8285

8386
# push to github pages
84-
if [[ $CI == true ]]; then
87+
if [[ $PUSH == true ]]; then
8588
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
8689
GIT_AUTHOR=$(git --no-pager show -s --format='%an <%ae>' HEAD)
8790
git fetch origin +gh-pages:gh-pages
8891
git checkout gh-pages
8992
rm -rf "docs"
90-
cp -r "$tmp/docs" .
93+
cp -r "$jazzy_dir/docs" .
9194
cp -r "docs/$version" docs/current
9295
git add --all docs
9396
echo '<html><head><meta http-equiv="refresh" content="0; url=docs/current/Logging/index.html" /></head></html>' > index.html

0 commit comments

Comments
 (0)