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

CONTRIB: Automate update of API documentation #10333

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
56 changes: 56 additions & 0 deletions contrib/api_update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env bash
#
# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# See file LICENSE for terms.
#

set -euE

branch="${1?Specify remote version to use like "upstream/v1.18.x"}"
remote="${branch%%/*}"
version="$(echo "${branch##*/}" | sed -e 's@\(v[0-9]\+\.[0-9]\+\).*@\1@')"

if ! git diff-index --quiet HEAD
then
echo "Current tree is not clean"
exit 1
fi

if ! git rev-parse --verify --quiet "$branch" >/dev/null
then
echo "Branch \"$branch\" does not exist"
exit 1
fi

echo "Proceed with clean checkout of $branch (${version})?"
read -r -p "press <enter>"

set -x

if grep -qi "debian\|ubuntu" /etc/os-release 2>/dev/null
then
sudo apt-get -y install doxygen doxygen-latex
else
sudo yum -y install doxygen doxygen-latex
fi

git checkout "$branch"
git clean -xdf
git reset --hard
Comment on lines +38 to +39
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks dangerous. Maybe mention it explicitly/(more clear) on line 18

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added check to address comment


./autogen.sh
./configure --with-docs-only
make docs

git checkout "$remote"/gh-pages
mkdir api/"$version"
ln -snf "$version" api/latest

cp docs/doxygen-doc/ucx.pdf "api/$version/ucx-$version.pdf"
ln -s "ucx-$version.pdf" "api/$version/ucx.pdf"
cp -ar docs/doxygen-doc/html "api/$version/"

git add api/latest "api/$version"
git commit -m "add $version documentation"

git --no-pager show --stat
Loading