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

mck pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-website.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 466d6ffe4 ninjafix – don't do inline sed (for compatibility) and don't 
do `ant echo-base-version` (it doesn't exist)
466d6ffe4 is described below

commit 466d6ffe4624b4a4a09b9946472045a7d48097ea
Author: mck <[email protected]>
AuthorDate: Thu Jun 29 12:18:11 2023 +0200

    ninjafix – don't do inline sed (for compatibility) and don't do `ant 
echo-base-version` (it doesn't exist)
---
 site-content/docker-entrypoint.sh | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/site-content/docker-entrypoint.sh 
b/site-content/docker-entrypoint.sh
index 183e60784..40c2be430 100755
--- a/site-content/docker-entrypoint.sh
+++ b/site-content/docker-entrypoint.sh
@@ -60,7 +60,7 @@ generate_cassandra_versioned_docs() {
     # Nodetool docs are autogenerated, and that needs nodetool to be built. 
However, before we can build nodetool we
     # need to select the correct Java version
     local doc_version=""
-    doc_version=$(ant echo-base-version | grep "\[echo\]" | tr -s ' ' | cut 
-d' ' -f3)
+    doc_version=$(grep 'property\s*name=\"base.version\"' build.xml |sed -ne 
's/.*value=\"\([^"]*\)\".*/\1/p')
 
     local java_version=""
     local javac_version=""
@@ -73,6 +73,7 @@ generate_cassandra_versioned_docs() {
       ant_cmd_options=""
     else
       # For Cassandra 4.0+ docs use JDK 11
+      # TODO – from 5 onwards, we can detect the default JDK version from the 
build.xml file
       java_version="/usr/lib/jvm/java-11-openjdk-amd64/bin/java"
       javac_version="/usr/lib/jvm/java-11-openjdk-amd64/bin/javac"
       ant_cmd_options="-Duse.jdk11=true"
@@ -91,7 +92,8 @@ generate_cassandra_versioned_docs() {
       # Remove the doc/* directory entries in the .gitignore file so we can 
commit the generated docs to the working
       # Cassandra repository. This needs to be done so Antora can retrieve the 
generated docs from each branch when
       # generating the HTML.
-      sed -i '/^doc/d' .gitignore
+      sed '/^doc/d' .gitignore > /tmp/tmp_gitignore
+      mv /tmp/tmp_gitignore .gitignore
       git add .
       git commit -m "Automated commit: Generated nodetool and configuration 
documentation for version ${doc_version}." || log_message "INFO" "No new 
changes to commit."
     fi
@@ -210,6 +212,7 @@ prepare_site_html_for_publication() {
   log_message "INFO" "Moving site HTML to content/"
   mkdir -p content/doc
   cp -r site-content/build/html/* content/
+  #rm -f content/_/sed*
 
   # remove hardcoded domain name, and empty domain names first before we 
duplicate and documentation
   content_files_to_change=($(grep -rl 'https://cassandra.apache.org/' 
content/))
@@ -219,7 +222,8 @@ prepare_site_html_for_publication() {
     log_message "DEBUG" "Processing file ${content_file}"
     # sed automatically uses the character following the 's' as a delimiter.
     # In this case we will use the ',' so we can avoid the need to escape the 
'/' characters
-    sed -i 's,https://cassandra.apache.org/,/,g' ${content_file}
+    sed 's,https://cassandra.apache.org/,/,g' ${content_file} > /tmp/tmp_sed
+    mv /tmp/tmp_sed ${content_file}
   done
 
   content_files_to_change=($(grep -rl 'href="//' content/))
@@ -227,7 +231,8 @@ prepare_site_html_for_publication() {
   for content_file in ${content_files_to_change[*]}
   do
     log_message "DEBUG" "Processing file ${content_file}"
-    sed -i 's,href="//,href="/,g' ${content_file}
+    sed  's,href="//,href="/,g' ${content_file} > /tmp/tmp_sed
+    mv /tmp/tmp_sed ${content_file}
   done
 
   # move around the in-tree docs if generated


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

Reply via email to