From 9106af0d7f7074238dfff0fedc4ca2f17cc796df Mon Sep 17 00:00:00 2001 From: Thomas Vegas Date: Tue, 26 Nov 2024 11:03:48 +0000 Subject: [PATCH 1/2] CONTRIB: Automate update of API documentation --- contrib/api_update.sh | 44 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 contrib/api_update.sh diff --git a/contrib/api_update.sh b/contrib/api_update.sh new file mode 100755 index 00000000000..2e1223dddbc --- /dev/null +++ b/contrib/api_update.sh @@ -0,0 +1,44 @@ +#!/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 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 + +set -x + +sudo yum -y install doxygen doxygen-latex + +git checkout "$branch" +git clean -xdf +git reset --hard + +./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 From e2261e3c373b7bf1b2802f48b2317197762c1c11 Mon Sep 17 00:00:00 2001 From: Thomas Vegas Date: Fri, 29 Nov 2024 12:02:18 +0200 Subject: [PATCH 2/2] CONTRIB: Address review comments --- contrib/api_update.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/contrib/api_update.sh b/contrib/api_update.sh index 2e1223dddbc..ded1dcae6d5 100755 --- a/contrib/api_update.sh +++ b/contrib/api_update.sh @@ -10,17 +10,29 @@ 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 rev-parse --verify --quiet "$branch" >/dev/null; then +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 +read -r -p "press " set -x -sudo yum -y install doxygen doxygen-latex +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