rdblue commented on code in PR #8659:
URL: https://github.com/apache/iceberg/pull/8659#discussion_r1367530477


##########
site/.github/bin/deploy_docs.sh:
##########
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+while [[ "$#" -gt 0 ]]; do
+    case $1 in
+        -v|--version) ICEBERG_VERSION="$2"; shift ;;
+        *) echo "Unknown parameter passed: $1"; exit 1 ;;
+    esac
+    shift
+done
+
+GIT_BRANCH="docs-${ICEBERG_VERSION}"
+
+# change to branch
+git checkout -b $GIT_BRANCH
+
+cd ..
+
+# remove all files and directories minus exceptions
+find . \
+ -not \( -path . \) \
+ -not \( -path .. \) \
+ -not \( -path ./.git -prune \) \
+ -not \( -path ./.github -prune \) \
+ -not \( -path ./docs-new  -prune \) \
+ ! -name LICENSE \
+ ! -name NOTICE \
+ -exec rm -rf {} +
+
+# move the nightly docs to the root and change from 'nightly'
+mv docs-new ./tmp && \
+mv ./tmp/docs/docs/nightly/* . && \
+rm -r ./tmp
+
+#delete top-level directories
+rm -r ./docs-new
+
+# update versions in mkdocs.yml
+sed -i '' -E "s/(^site\_name:[[:space:]]+docs\/).*$/\1${ICEBERG_VERSION}/" 
"./mkdocs.yml" 
+sed -i '' -E 
"s/(^[[:space:]]*-[[:space:]]+Javadoc:.*\/javadoc\/)nightly/\1${ICEBERG_VERSION}/"
 "./mkdocs.yml"
+
+cd docs
+
+# add exclude search for older documentation
+python3 -c "import os
+for f in filter(lambda x: x.endswith('.md'), os.listdir()): lines = 
open(f).readlines(); open(f, 'w').writelines(lines[:2] + ['search:\n', '  
exclude: true\n'] + lines[2:]);"
+
+cd ..
+
+git add .

Review Comment:
   Adding specific folders would avoid the need to delete things.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to