You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by ti...@apache.org on 2023/01/11 08:29:59 UTC
[pulsar-site] 01/02: [cleanup] Remove legacy scripts
This is an automated email from the ASF dual-hosted git repository.
tison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git
commit 19ddbf60bc798cbf2e229f6a44c7b813fe907065
Author: tison <wa...@gmail.com>
AuthorDate: Wed Jan 11 16:27:24 2023 +0800
[cleanup] Remove legacy scripts
Signed-off-by: tison <wa...@gmail.com>
---
tools/build-site.sh | 45 -----------------------------
tools/docker-build-site.sh | 41 --------------------------
tools/publish-website.sh | 72 ----------------------------------------------
3 files changed, 158 deletions(-)
diff --git a/tools/build-site.sh b/tools/build-site.sh
deleted file mode 100755
index 32145cde7a4..00000000000
--- a/tools/build-site.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/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 -x -e
-
-GH_TOKEN=$1
-
-ROOT_DIR=$(git rev-parse --show-toplevel)
-
-WEBSITE_DIR=${ROOT_DIR}/
-TOOLS_DIR=${ROOT_DIR}/tools
-GEN_SITE_DIR=${ROOT_DIR}/generated-site
-VERSION=next
-
-export NODE_OPTIONS="--max-old-space-size=16000"
-
-cd "$WEBSITE_DIR"
-
-npm install
-
-node scripts/replace.js
-# Because there are too many versions of the document, the memory overflows during the full build.
-# The split-version-build script is used to build in different versions, and finally the build results are merged.
-bash scripts/split-version-build.sh $@
-
-CONTENT_DIR="$GEN_SITE_DIR"/content
-rm -rf "$CONTENT_DIR" && mkdir -p "$CONTENT_DIR"
-rsync -a ./build/ "$CONTENT_DIR"
diff --git a/tools/docker-build-site.sh b/tools/docker-build-site.sh
deleted file mode 100755
index b6c00b2e74e..00000000000
--- a/tools/docker-build-site.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/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.
-#
-
-# Build Pulsar website within a Docker container
-
-set -e -x
-
-ROOT_DIR=$(git rev-parse --show-toplevel)
-
-BUILD_IMAGE_NAME="${BUILD_IMAGE_NAME:-apachepulsar/pulsar-build}"
-BUILD_IMAGE_VERSION="${BUILD_IMAGE_VERSION:-website-v2}"
-
-IMAGE="$BUILD_IMAGE_NAME:$BUILD_IMAGE_VERSION"
-
-echo "---- Build Pulsar website using image $IMAGE"
-
-CI_USER=$(id -u)
-CI_GROUP=$(id -g)
-
-DOCKER_CMD="docker run -i -e CI_USER=$CI_USER -e CI_GROUP=$CI_GROUP -v $HOME/.m2:/root/.m2 -v $ROOT_DIR:/pulsar $IMAGE"
-
-CMD="cd /pulsar && /pulsar/tools/build-site.sh $GH_TOKEN $@"
-echo "docker exec cmd: "$CMD
-$DOCKER_CMD bash -l -c "$CMD"
diff --git a/tools/publish-website.sh b/tools/publish-website.sh
deleted file mode 100755
index ffe11eb8ec7..00000000000
--- a/tools/publish-website.sh
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/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 -x -e
-
-ROOT_DIR=$(git rev-parse --show-toplevel)
-
-ORIGIN_REPO=$(git remote show origin | grep 'Push URL' | awk -F// '{print $NF}')
-echo "ORIGIN_REPO: $ORIGIN_REPO"
-
-NEXT=$1
-BRANCH_CONTENT="asf-site"
-if [ -n "$NEXT" ]; then
- BRANCH_CONTENT="asf-site-"$NEXT
-fi
-
-GENERATED_SITE_DIR=$ROOT_DIR/generated-site
-
-PULSAR_SITE_TMP=/tmp/pulsar-site
-(
- cd $ROOT_DIR
- REVISION=$(git rev-parse --short HEAD)
- BUILD_ALL=$(cat $ROOT_DIR/scripts/.build)
-
- rm -rf $PULSAR_SITE_TMP
- mkdir $PULSAR_SITE_TMP
- cd $PULSAR_SITE_TMP
-
- git clone -b $BRANCH_CONTENT --depth 1 "https://$GH_TOKEN@$ORIGIN_REPO" .
- git config user.name "Pulsar Site Updater"
- git config user.email "dev@pulsar.apache.org"
-
- # copy the apache generated dir
- if [ ! -d "$PULSAR_SITE_TMP/content/" ]; then
- mkdir -p $PULSAR_SITE_TMP/content/
- fi
-
- echo "BUILD_ALL:"$BUILD_ALL
- if [[ $BUILD_ALL"" == "1" ]]; then
- echo "clean all the old content"
- find $PULSAR_SITE_TMP/content -print \
- | grep -v $PULSAR_SITE_TMP/content$ \
- | grep -v $PULSAR_SITE_TMP/content/api \
- | grep -v $PULSAR_SITE_TMP/content/charts \
- | grep -v $PULSAR_SITE_TMP/content/css \
- | grep -v $PULSAR_SITE_TMP/content/tools \
- | xargs rm -rf
- fi
- rsync -a $GENERATED_SITE_DIR/content/ $PULSAR_SITE_TMP/content
-
- git add -A .
- git diff-index --quiet HEAD || (git commit -m "Updated site at revision $REVISION" && git push -q origin HEAD:$BRANCH_CONTENT)
-
- rm -rf $PULSAR_SITE_TMP
-)