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

wenchen pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/spark-website.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new 3def12e7fa improve build script and instruction (#675)
3def12e7fa is described below

commit 3def12e7fa44ebacd4cee0c73d60f7c2b4cfee3b
Author: Cheng Pan <[email protected]>
AuthorDate: Wed Feb 11 01:12:58 2026 +0800

    improve build script and instruction (#675)
---
 .dev/build-docs.sh       |  2 +-
 .dev/run-in-container.sh | 13 +++++++------
 README.md                |  2 +-
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/.dev/build-docs.sh b/.dev/build-docs.sh
old mode 100644
new mode 100755
index c4297b4177..ad669e14a7
--- a/.dev/build-docs.sh
+++ b/.dev/build-docs.sh
@@ -21,4 +21,4 @@ docker run \
   --mount type=bind,source="$PWD",target="/spark-website" \
   -w /spark-website \
   docs-builder:latest \
-  /bin/bash -c "sh .dev/run-in-container.sh"
+  /bin/bash -c ".dev/run-in-container.sh"
diff --git a/.dev/run-in-container.sh b/.dev/run-in-container.sh
old mode 100644
new mode 100755
index 1ba306d629..c68e672601
--- a/.dev/run-in-container.sh
+++ b/.dev/run-in-container.sh
@@ -16,20 +16,21 @@
 #
 
 # 1.Set env variable.
-export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-arm64
-export PATH=$JAVA_HOME/bin:$PATH
+export JAVA_HOME="/usr/lib/jvm/$(ls /usr/lib/jvm/ | grep java-17-openjdk | awk 
'{print $NF}')"
+export PATH="$JAVA_HOME/bin:$PATH"
 
 # 2.Install bundler.
 gem install bundler -v 2.4.22
 bundle install
 
-# 3. Create a user matching the host UID/GID
-groupadd -g $HOST_GID docuser
-useradd -u $HOST_UID -g $HOST_GID -m docuser
+# 3. Create a user matching the host UID/GID, if it doesn't exist
+groupadd -g $HOST_GID docuser || true
+useradd -u $HOST_UID -g $HOST_GID -m docuser || true
+DOC_USER=$(getent passwd "$HOST_UID" | cut -d: -f1)
 
 # We need this link to make sure `python3` points to `python3.11` which 
contains the prerequisite packages.
 ln -s "$(which python3.11)" "/usr/local/bin/python3"
 
 # Build docs
 rm -rf .jekyll-cache
-su docuser -c "bundle exec jekyll build"
+su "$DOC_USER" -c "bundle exec jekyll build"
diff --git a/README.md b/README.md
index 2e3e003dc6..bef477a201 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ docker build \
 Once the image is built, navigate to the `spark-website` root directory, run 
the script which processes
 the Markdown files in the Docker container.
 ```
-SPARK_WEBSITE_PATH="/path/to/spark-website" sh .dev/build-docs.sh
+.dev/build-docs.sh
 ```
 
 ## Docs sub-dir


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to