You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2021/07/06 15:38:00 UTC

[flink-web] branch asf-site updated: [FLINK-23258] Make incremental builds explicit and log a warning

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

chesnay pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/flink-web.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new 85e093c  [FLINK-23258] Make incremental builds explicit and log a warning
85e093c is described below

commit 85e093cf7d2608f016f98740af65f635c6ec7b7e
Author: Chesnay Schepler <ch...@apache.org>
AuthorDate: Tue Jul 6 17:37:51 2021 +0200

    [FLINK-23258] Make incremental builds explicit and log a warning
---
 README.md |  5 +++--
 build.sh  | 20 ++++++++++++++------
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md
index a991180..cdad660 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ You find instructions for this repository here: https://flink.apache.org/contrib
 ## Testing changes locally
 
 You can build the website using Docker such as below (without augmenting your host environment). Parameters passed as 
-part of this call will be forwarded to `build.sh`.
+part of this call will be forwarded to `build.sh`. The `-i` option can be used to enable incremental builds.
 ```bash
 # starts website with future post being disabled
 bash docker-build.sh -p
@@ -18,11 +18,12 @@ bash docker-build.sh -f
 
 Both commands will start a webserver providing the website via `http://0.0.0.0:4000`.
 
-If a newly added blog post is not showing up on the index / blog overview page, delete the "content" directory before building the page locally. The "content" directory will be regenerated completely, including the newly added blog post.
+If a newly added blog post is not showing up on the index / blog overview page, build the website again without the `-i` option, or delete the "content" directory before building the page locally. The "content" directory will be regenerated completely, including the newly added blog post.
 
 ## Building website
 
 The site needs to be rebuild before merging into the branch asf-site.
+When doing so, DO NOT use incremental builds.
 ```bash
 bash docker-build.sh
 ```
diff --git a/build.sh b/build.sh
index 6823038..2eef146 100755
--- a/build.sh
+++ b/build.sh
@@ -49,18 +49,26 @@ DOCS_DST=${DOCS_SRC}/content
 
 # default jekyll command is to just build site
 JEKYLL_CMD="build"
+INCREMENTAL=""
 
 # if -p flag is provided, serve site on localhost
-while getopts ":pf" opt; do
+while getopts ":pfi" opt; do
     case $opt in
         p)
-        JEKYLL_CMD="serve --baseurl= --watch --trace --incremental"
-        break;;
+        JEKYLL_CMD="serve --baseurl= --watch --trace"
+        ;;
         f)
-        JEKYLL_CMD="serve --baseurl= --watch --trace --incremental --future"
-        break;;
+        JEKYLL_CMD="serve --baseurl= --watch --trace --future"
+        ;;
+        i)
+        echo "Incremental build enabled."
+        echo "Do NOT use incremental builds when building the site for publication."
+        echo "Incremental builds _can_ result in newly added blog posts not being displayed."
+        echo "If that happens, run this script once without incremental builds."
+        INCREMENTAL="--incremental"
+        ;;
     esac
 done
 
 # use 'bundle exec' to insert the local Ruby dependencies
-bundle exec jekyll ${JEKYLL_CMD} --source "${DOCS_SRC}" --destination "${DOCS_DST}"
+bundle exec jekyll ${JEKYLL_CMD} ${INCREMENTAL} --source "${DOCS_SRC}" --destination "${DOCS_DST}"