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

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


The following commit(s) were added to refs/heads/master by this push:
     new a70f6b0  [SCRIPT] Add docs update script. (#5)
a70f6b0 is described below

commit a70f6b08245e680af8941830a7c47e9ff6e98345
Author: Tianqi Chen <[email protected]>
AuthorDate: Mon Mar 30 10:04:33 2020 -0700

    [SCRIPT] Add docs update script. (#5)
---
 .gitignore                      |  2 +-
 README.md                       |  4 +++-
 _config.yml                     |  2 ++
 scripts/task_deploy_asf_site.sh |  7 +++++--
 scripts/task_docs_update.sh     | 35 +++++++++++++++++++++++++++++++++++
 5 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/.gitignore b/.gitignore
index 49a54c6..7aaaff4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,4 @@ _site
 website.tgz
 *.bak
 .jekyll-cache
-
+docs.tgz
diff --git a/README.md b/README.md
index 226efab..8306a88 100644
--- a/README.md
+++ b/README.md
@@ -8,5 +8,7 @@
 
 ## Deployment
 
-We use the script 
[scripts/deploy_to_asf_site.sh](scripts/deploy_to_asf_site.sh)
+We use the script 
[scripts/task_deploy_asf_site.sh](scripts/task_deploy_asf_site.sh)
 to generate and deploy content to the asf-site branch.
+
+The documentations are copied and updated separately via 
[scripts/task_docs_update.sh](scripts/task_docs_update.sh)
diff --git a/_config.yml b/_config.yml
index f262236..6862049 100644
--- a/_config.yml
+++ b/_config.yml
@@ -13,6 +13,8 @@ exclude: [".rvmrc",
           "CNAME",
           "README.md",
           "website.tgz",
+          "docs.tgz",
+          "docs",
           "serve_local.sh"]
 
 highlighter: rouge
diff --git a/scripts/task_deploy_asf_site.sh b/scripts/task_deploy_asf_site.sh
index 7cb749f..90f8180 100755
--- a/scripts/task_deploy_asf_site.sh
+++ b/scripts/task_deploy_asf_site.sh
@@ -2,12 +2,15 @@
 # Deploy the website to the asf-site branch.
 set -e
 set -u
+
 echo "Start to generate and deploy site ..."
 jekyll b
 cp .gitignore .gitignore.bak
 git checkout asf-site
-# remove all existing files
-git ls-files | xargs  rm -f
+
+# remove all existing files, excluding the docs
+git ls-files | grep -v ^docs| xargs  rm -f
+
 # copy new files into the current site
 cp .gitignore.bak .gitignore
 cp -rf _site/* .
diff --git a/scripts/task_docs_update.sh b/scripts/task_docs_update.sh
new file mode 100755
index 0000000..54ec667
--- /dev/null
+++ b/scripts/task_docs_update.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+# Deploy the docs to the asf-site branch.
+set -e
+set -u
+set -o pipefail
+
+cleanup()
+{
+    git checkout master
+}
+trap cleanup 0
+
+echo "Start to update docs ..."
+
+DOCS_TGZ=docs.tgz
+
+if [ ! -f "$DOCS_TGZ" ]; then
+    echo "$DOCS_TGZ does not exist!!"
+    exit 255
+fi
+
+cp .gitignore .gitignore.bak
+git checkout asf-site
+
+# remove all docs files
+git ls-files | grep -e ^docs | xargs  rm -f
+cp .gitignore.bak .gitignore
+
+mkdir -p docs
+tar xf "$DOCS_TGZ" -C docs
+
+DATE=`date`
+git add --all && git commit -am "Docs build at ${DATE}"
+git push origin asf-site
+echo "Finish docs update at ${DATE}"

Reply via email to