From commits-return-7688-archive-asf-public=cust-asf.ponee.io@kudu.apache.org Thu Jul 11 12:58:27 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2504D1804BB for ; Thu, 11 Jul 2019 14:58:27 +0200 (CEST) Received: (qmail 74015 invoked by uid 500); 11 Jul 2019 12:58:26 -0000 Mailing-List: contact commits-help@kudu.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kudu.apache.org Delivered-To: mailing list commits@kudu.apache.org Received: (qmail 73998 invoked by uid 99); 11 Jul 2019 12:58:26 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jul 2019 12:58:26 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 48A3C85E09; Thu, 11 Jul 2019 12:58:26 +0000 (UTC) Date: Thu, 11 Jul 2019 12:58:28 +0000 To: "commits@kudu.apache.org" Subject: [kudu] 02/02: [docs] Update the site build to use the release directory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: granthenke@apache.org In-Reply-To: <156284990620.25961.4776491286851287023@gitbox.apache.org> References: <156284990620.25961.4776491286851287023@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: kudu X-Git-Refname: refs/heads/branch-1.10.x X-Git-Reftype: branch X-Git-Rev: 567782e0377c554433970b66f7a66f62783b8b8d X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20190711125826.48A3C85E09@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. granthenke pushed a commit to branch branch-1.10.x in repository https://gitbox.apache.org/repos/asf/kudu.git commit 567782e0377c554433970b66f7a66f62783b8b8d Author: Grant Henke AuthorDate: Wed Jul 10 12:21:14 2019 -0500 [docs] Update the site build to use the release directory Updates the make_site.sh script and make_docs.sh script to generate docs in the versioned release directory. This matches the new symbolic linking style we have been using for the docs and avoids the need to manually copy the docs during release. An additional flag to skip updating the symbolic links (`—no-link`) was added. Change-Id: I174de2d7041bba20cdc3dcacd3efbb5e736ecb63 Reviewed-on: http://gerrit.cloudera.org:8080/13835 Reviewed-by: Andrew Wong Tested-by: Andrew Wong (cherry picked from commit 819a85fbb1d836f70a50c136dfcdaebc37faf7a8) Reviewed-on: http://gerrit.cloudera.org:8080/13840 Tested-by: Kudu Jenkins --- docs/support/scripts/make_docs.sh | 16 ++++++++++--- docs/support/scripts/make_site.sh | 49 ++++++++++++++++++++++++++++++++------- 2 files changed, 54 insertions(+), 11 deletions(-) diff --git a/docs/support/scripts/make_docs.sh b/docs/support/scripts/make_docs.sh index b9837ba..1b0b742 100755 --- a/docs/support/scripts/make_docs.sh +++ b/docs/support/scripts/make_docs.sh @@ -31,7 +31,7 @@ set -e usage() { - echo usage: "$0 --build_root [--site ]" + echo usage: "$0 --build_root --output_subdir [--site ]" } while [[ $# > 0 ]] ; do @@ -60,7 +60,15 @@ while [[ $# > 0 ]] ; do exit 1 fi SITE=$(cd $SITE && pwd) - OUTPUT_DIR=$SITE/docs + ;; + --output_subdir|-o) + OUTPUT_SUBDIR=$2 + if [ -z "$OUTPUT_SUBDIR" ]; then + usage + exit 1 + fi + shift + shift ;; --no-jekyll) NO_JEKYLL=1 @@ -78,7 +86,9 @@ if [ -z "$BUILD_ROOT" ]; then fi if [ -z "$SITE" ]; then - OUTPUT_DIR=$BUILD_ROOT/docs + OUTPUT_DIR=$BUILD_ROOT/$OUTPUT_SUBDIR +else + OUTPUT_DIR=$SITE/$OUTPUT_SUBDIR fi GEN_DOC_DIR=$BUILD_ROOT/gen-docs diff --git a/docs/support/scripts/make_site.sh b/docs/support/scripts/make_site.sh index e6cd7f3..0d7d738 100755 --- a/docs/support/scripts/make_site.sh +++ b/docs/support/scripts/make_site.sh @@ -24,17 +24,22 @@ set -e BUILD_TYPE=release SOURCE_ROOT=$(cd $(dirname $0)/../../..; pwd) +VERSION=$(cat $SOURCE_ROOT/version.txt) BUILD_ROOT="$SOURCE_ROOT/build/$BUILD_TYPE" SITE_OUTPUT_DIR="$BUILD_ROOT/site" +RELEASE_SUBDIR=releases/$VERSION +RELEASE_OUTPUT_DIR="$SITE_OUTPUT_DIR/releases/$VERSION" OPT_DOXYGEN=1 # By default, build doxygen docs. OPT_JAVADOC=1 # By default, build javadocs. +OPT_LINK=1 # By default, update the top level symbolic links. OPT_FORCE='' # By default, don't overwrite the destination directory. usage() { echo "Usage: $0 [--no-doxygen] [--no-javadoc] [--force]" echo "Specify --no-doxygen to skip generation of the C++ client API docs" echo "Specify --no-javadoc to skip generation of the Java API docs" + echo "Specify --no-link to skip updating the top level symbolic links" echo "Specify --force to overwrite the destination directory, if it exists" exit 1 } @@ -44,6 +49,7 @@ if [ $# -gt 0 ]; then case $arg in "--no-doxygen") OPT_DOXYGEN='' ;; "--no-javadoc") OPT_JAVADOC='' ;; + "--no-link") OPT_LINK='' ;; "--force") OPT_FORCE=1 ;; "--help") usage ;; "-h") usage ;; @@ -96,16 +102,27 @@ if [ -d "$SITE_OUTPUT_DIR" -a -n "$OPT_FORCE" ]; then fi git clone -q "$GIT_REMOTE" --reference "$SOURCE_ROOT" -b gh-pages --depth 1 "$SITE_OUTPUT_DIR" +# Make the RELEASE_OUTPUT_DIR in case it doesn't exist. +mkdir -p "$RELEASE_OUTPUT_DIR" + # Build the docs using the styles from the Jekyll site -rm -Rf "$SITE_OUTPUT_DIR/docs" -$SOURCE_ROOT/docs/support/scripts/make_docs.sh --build_root $BUILD_ROOT --site "$SITE_OUTPUT_DIR" -if [ -f "$SITE_OUTPUT_DIR/docs/index.html" ]; then +DOC_SUBDIR="docs" +rm -Rf "$RELEASE_OUTPUT_DIR/$DOC_SUBDIR" +$SOURCE_ROOT/docs/support/scripts/make_docs.sh --build_root $BUILD_ROOT --site "$SITE_OUTPUT_DIR" \ + --output_subdir "$RELEASE_SUBDIR/$DOC_SUBDIR" +if [ -f "$RELEASE_OUTPUT_DIR/docs/index.html" ]; then echo "Successfully built docs." else echo "Docs failed to build." exit 1 fi +if [ -n "$OPT_LINK" ]; then + # Update the top level docs symbolic link. + rm "$SITE_OUTPUT_DIR/$DOC_SUBDIR" + ln -s "$RELEASE_SUBDIR/$DOC_SUBDIR" "$SITE_OUTPUT_DIR/$DOC_SUBDIR" +fi + if [ -n "$OPT_JAVADOC" ]; then JAVADOC_SUBDIR="apidocs" cd "$SOURCE_ROOT/java" @@ -122,14 +139,26 @@ if [ -n "$OPT_JAVADOC" ]; then exit 1 fi - rm -Rf "$SITE_OUTPUT_DIR/$JAVADOC_SUBDIR" - cp -a "$SOURCE_ROOT/java/build/docs/javadoc/." "$SITE_OUTPUT_DIR/$JAVADOC_SUBDIR" + rm -Rf "$RELEASE_OUTPUT_DIR/$JAVADOC_SUBDIR" + cp -a "$SOURCE_ROOT/java/build/docs/javadoc/." "$RELEASE_OUTPUT_DIR/$JAVADOC_SUBDIR" + + if [ -n "$OPT_LINK" ]; then + # Update the top level javadoc symbolic link. + rm "$SITE_OUTPUT_DIR/$JAVADOC_SUBDIR" + ln -s "$RELEASE_SUBDIR/$JAVADOC_SUBDIR" "$SITE_OUTPUT_DIR/$JAVADOC_SUBDIR" + fi fi if [ -n "$OPT_DOXYGEN" ]; then CPP_CLIENT_API_SUBDIR="cpp-client-api" - rm -Rf "$SITE_OUTPUT_DIR/$CPP_CLIENT_API_SUBDIR" - cp -a "$BUILD_ROOT/docs/doxygen/client_api/html" "$SITE_OUTPUT_DIR/$CPP_CLIENT_API_SUBDIR" + rm -Rf "$RELEASE_OUTPUT_DIR/$CPP_CLIENT_API_SUBDIR" + cp -a "$BUILD_ROOT/docs/doxygen/client_api/html" "$RELEASE_OUTPUT_DIR/$CPP_CLIENT_API_SUBDIR" + + if [ -n "$OPT_LINK" ]; then + # Update the top level cpp-client-api symbolic link. + rm "$SITE_OUTPUT_DIR/$CPP_CLIENT_API_SUBDIR" + ln -s "$RELEASE_SUBDIR/$CPP_CLIENT_API_SUBDIR" "$SITE_OUTPUT_DIR/$CPP_CLIENT_API_SUBDIR" + fi fi SITE_SUBDIRS="docs" @@ -142,9 +171,13 @@ fi cd "$SITE_OUTPUT_DIR" SITE_ARCHIVE="$SITE_OUTPUT_DIR/website_archive.zip" -zip -rq "$SITE_ARCHIVE" $SITE_SUBDIRS +zip -rq "$SITE_ARCHIVE" "$RELEASE_OUTPUT_DIR" set +x echo "Generated web site at $SITE_OUTPUT_DIR" +echo "Release documentation generated at $RELEASE_OUTPUT_DIR" +if [ -n "$OPT_LINK" ]; then + echo "Top level symbolic links were updated" +fi echo "Docs zip generated at $SITE_ARCHIVE" echo "To view live site locally, run: (cd $SITE_OUTPUT_DIR && ./site_tool jekyll serve)"