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

xiangfu pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/incubator-pinot-site.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new b388c42  Adding build and publish scripts
     new 37108b5  Merge pull request #27 from ChethanUK/f/scripts
b388c42 is described below

commit b388c420ad686a187e2fb443d7126dd2e34f0df5
Author: ChethanUK <chetha...@outlook.com>
AuthorDate: Sat Apr 24 03:15:29 2021 +0530

    Adding build and publish scripts
---
 README.md                       |  2 +-
 website/scripts/build-site.sh   | 36 +++++++++++++++++++++++++++++
 website/scripts/publish_site.sh | 51 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 88 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index d935e65..9f7343d 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@ Update Website Content
 
 Build from source
 ```bash
-$ website-builder/scripts/build-site.sh
+$ website/scripts/build-site.sh
 ```
 
 Maintainer
diff --git a/website/scripts/build-site.sh b/website/scripts/build-site.sh
new file mode 100755
index 0000000..83842d2
--- /dev/null
+++ b/website/scripts/build-site.sh
@@ -0,0 +1,36 @@
+#!/bin/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.
+#
+
+ROOT_DIR=$(git rev-parse --show-toplevel)
+
+VERSION=0.30
+
+set -x -e
+
+cd ${ROOT_DIR}/website
+npm install yarn
+yarn install
+yarn run build
+
+rm -rf ${ROOT_DIR}/content
+
+## copy generated site
+cp -R build/ ${ROOT_DIR}/content/
+
diff --git a/website/scripts/publish_site.sh b/website/scripts/publish_site.sh
new file mode 100644
index 0000000..9b3a87c
--- /dev/null
+++ b/website/scripts/publish_site.sh
@@ -0,0 +1,51 @@
+#!/bin/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 -e
+
+ROOT_DIR=$(git rev-parse --show-toplevel)
+WORK_DIR=${ROOT_DIR}/build
+ME=`basename $0`
+echo "Basename $ME"
+
+# ORIGIN_REPO=$(git remote show origin | grep 'Push  URL' | awk -F// '{print 
$NF}')
+ORIGIN_REPO="https://github.com/apache/incubator-pinot-site";
+echo "ORIGIN_REPO: $ORIGIN_REPO"
+
+SITE_TMP=/tmp/pinot-site 
+(
+
+  cd $ROOT_DIR
+  rm -rf $SITE_TMP
+  mkdir $SITE_TMP
+  cd $SITE_TMP
+
+  git clone "https://$GH_TOKEN@$ORIGIN_REPO"; .
+  git config user.name "Pinot Site Updater"
+  git config user.email "d...@pinot.apache.org"
+  git checkout asf-master
+
+  # Clean content directory
+  rm -rf $SITE_TMP/content/
+  mkdir $SITE_TMP/content
+
+  # Copy the generated directory to asf folder
+  cp -r $WORK_DIR/* $SITE_TMP/content
+)
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to