This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn-website.git

commit 11fc6d8ab08c31e7a9a3865feded73526c7f3aa4
Author: Celeborn <[email protected]>
AuthorDate: Mon Nov 27 01:08:49 2023 +0000

    .github/bin/build_docs.sh
---
 .github/bin/build_docs.sh | 48 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/.github/bin/build_docs.sh b/.github/bin/build_docs.sh
new file mode 100755
index 0000000..01b4397
--- /dev/null
+++ b/.github/bin/build_docs.sh
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+set -o pipefail
+set -e
+set -x
+
+function exit_with_usage {
+  echo "./github/bin/build_docs.sh <ref_version_name> <doc_link_path>"
+  exit 1
+}
+
+if [ $# -ne 2 ]; then
+  exit_with_usage
+fi
+
+REF_VERSION_NAME="$1"
+DOC_LINK_PATH="$2"
+
+TAR_NAME=${REF_VERSION_NAME##*/}
+DIR_VERSION_NAME=$(echo "$TAR_NAME" | sed -r "s/v*(.*)\.tar\.gz/\1/g")
+TAR_DIR_NAME=incubator-celeborn-$DIR_VERSION_NAME
+
+wget 
"https://github.com/apache/incubator-celeborn/archive/refs/${REF_VERSION_NAME}";
+tar -xzf $TAR_NAME
+cd $TAR_DIR_NAME
+mkdocs build
+cd ..
+mkdir -p docs
+if [ -d docs/$DOC_LINK_PATH ]; then rm -r docs/$DOC_LINK_PATH; fi
+mv $TAR_DIR_NAME/site docs/$DOC_LINK_PATH
+git add .
+git commit -m "docs/$DOC_LINK_PATH"
\ No newline at end of file

Reply via email to