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 f638579  CASSANDRA-16913: Updated UI Bundle URL
f638579 is described below

commit f6385794ff962c11365aebbfed90da6717770bf1
Author: Anthony Grasso <anth...@thelastpickle.com>
AuthorDate: Tue Dec 7 22:04:15 2021 +1100

    CASSANDRA-16913: Updated UI Bundle URL
    
    * Generated ui-bundle.zip and added it to repository under site-ui/build/
    * Updated bundle-ui URL in site-content Dockerfile to point to GitHub trunk 
version of ui-bundle.zip
    * Updated logic in ./run.sh to use by default the local copy of the 
ui-bundle.zip located in site-ui/build
    * Updated README.md to reflect changes to ./run.sh logic
    
    patch by Anthony Grasso; reviewed by Michael Semb Wever for CASSANDRA-16913
---
 .gitignore                  |   1 -
 README.md                   |  10 +++++-----
 run.sh                      |  35 ++++++++++++++++++++---------------
 site-content/Dockerfile     |   5 ++---
 site-ui/build/ui-bundle.zip | Bin 0 -> 4740057 bytes
 5 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/.gitignore b/.gitignore
index 9dd1f7b..6aaf298 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,5 @@
 /site-content/site.yaml
 /site-content/build/
 
-/site-ui/build/
 /site-ui/node_modules/
 /site-ui/public/
\ No newline at end of file
diff --git a/README.md b/README.md
index fda4bb4..8576d66 100644
--- a/README.md
+++ b/README.md
@@ -69,7 +69,7 @@ To build the website only, run the following command from 
within the `./cassandr
 $ ./run.sh website build
 ```
 
-This will build the website content using your local copy of the 
cassandra-website, and the current checked-out branch. Use this command if you 
want to make a change to a top-level webpage without building the docs for any 
versions of cassandra.
+This will use the current checked-out branch of your cassandra-website local 
copy to build the website content. In addition, the local copy of the UI bundle 
will be used to style the website content. Use this command if you want to make 
a change to a top-level webpage without building the docs for any versions of 
cassandra.
 
 Once building has completed, the HTML content will be in the 
`./site-content/build/html/` directory ready to be reviewed and committed.
 
@@ -225,9 +225,11 @@ $ ./run.sh \
     -u cassandra-website:/local/path/to/cassandra-website/repository
 ```
 
-### Generate the website using local copy of the ui-bundle
+### Generate the website using your own copy of the ui-bundle
 
-You can use your own *ui-bundle.zip* file containing the information on how to 
style the website when building it. The *ui-bundle.zip* file can be generated 
using the `./run.sh` script. See the [Building the Site 
UI](#building-the-site-ui) section for furher details on how to build the 
*ui-bundle.zip*.
+By default, the local copy of the *ui-bundle.zip* located in site-ui/build/ is 
used by Antora to style the website when it is built. The `./run.sh` script 
will pass the location of ui-bundle.zip to the Docker container that executes 
Antora.
+
+You can use your own *ui-bundle.zip* file containing the information on how to 
style the website when building it. The *ui-bundle.zip* file can be generated 
using the `./run.sh` script. See the [Building the Site 
UI](#building-the-site-ui) section for further details on how to build the 
*ui-bundle.zip*.
 
 To supply your own *ui-bundle.zip* file when building the website, run the 
following command.
 
@@ -243,8 +245,6 @@ $ ./run.sh website build -z 
https://github.com/apache/cassandra-website/archive/
 
 The styling contained in the *ui-bundle.zip* will be applied to docs if they 
are being rendered as well.
 
-By default, the Docker container used to render the site will reference a 
GitHub release version of the *ui-bundle.zip*.
-
 ## Building the Site UI
 
 To get a list of the tasks that can be executed, run the following commands.
diff --git a/run.sh b/run.sh
index fb8f635..2edeb25 100755
--- a/run.sh
+++ b/run.sh
@@ -111,7 +111,7 @@ Options
                                   specified multiple times. The valid values 
for REPOSITORY are only 'cassandra' and
                                   'cassandra-website'. The values for TAGS are 
split by comma with no spaces. The
                                   repository and list of tags are split by a 
colon ':'. For example:
-                                    -t 
cassandra:cassandra-4.0,cassandra-3.11,cassandra-3.0
+                                    -t 
cassandra:cassandra-4.0.1,cassandra-3.11.11
 
         -u REPOSITORY:URL         The location defined by URL of the 
repository defined by REPOSITORY that will be used
                                   as the source content to generate the docs 
and/or website. This option can be
@@ -122,17 +122,17 @@ Options
                                     -u 
cassandra:https://github.com/myfork/cassandra.git
 
         -z UI_BUNDLE_ZIP_URL      The UI bundle ZIP location defined by 
UI_BUNDLE_ZIP_URL that will be used to style the
-                                  website when it is built. The value be a 
HTTP url or a file location on your local
-                                  host.  For example:
+                                  website when it is built. By default, the 
script will use the UI bundle ZIP located in
+                                  the site-ui/build/ directory. The value for 
UI_BUNDLE_ZIP_URL can be a HTTP url or a
+                                  file location on your local host. For 
example:
                                     -z ~/local/path/to/ui-bundle.zip
 
         -a BUILD_ARG:VALUE        A container build argument defined by 
BUILD_ARG that overrides the default value with
-                                  the value for VALUE. This option can be 
specified multiple times and is only applied
-                                  when using the 'build' command. This option 
is ignored in all other cases. Possible
-                                  arguments for BUILD_ARG are 'UID_ARG', 
'GID_ARG', 'NODE_VERSION_ARG',
-                                  'ENTR_VERSION_ARG', and 
'CASSANDRA_REPOSITORY_URL_ARG'. The build argument and value
-                                  are split by a colon ':'. For example:
-                                    -v 
CASSANDRA_REPOSITORY_URL_ARG:https://github/user/my_cassandra_fork.git
+                                  VALUE. This option can be specified multiple 
times and is only applied when using the
+                                  'build' command, and is ignored in all other 
cases. Possible arguments for BUILD_ARG
+                                  are 'BUILD_USER_ARG', 'UID_ARG', 'GID_ARG', 
'NODE_VERSION_ARG', 'ENTR_VERSION_ARG'.
+                                  The build argument and value are split by a 
colon ':'. For example:
+                                    -v BUILD_USER_ARG:foobar
 
         -g                        Enable generation of versioned AsciiDoc 
(.adoc) files from the Cassandra source
                                   repository and include them when generating 
the website HTML. Use this option when you
@@ -523,14 +523,19 @@ EOF
 
     env_args+=("-e 
INCLUDE_VERSION_DOCS_WHEN_GENERATING_WEBSITE=${include_version_docs_when_generating_website}")
 
-    if [ -n "${ui_bundle_zip_url}" ]
+    # CASSANDRA-16913:
+    # Include the local site-ui/build/ui-bundle.zip automatically, unless an 
alternative path has been defined via the
+    # '-z' option. If we are on a custom branch, we would expect the local 
site-ui/build/ui-bundle.zip to be used from
+    # that branch. It would be unintuitive if an updated version of the file 
is there but left unused, and requires the
+    # user to specify the '-z' option.
+    if [ -z "${ui_bundle_zip_url}" ]
     then
-      local url_source_name=""
-      url_source_name=$(rev <<< "${ui_bundle_zip_url}" | cut -d'/' -f1 | rev)
-      local url_source_value="${ui_bundle_zip_url}"
-      set_antora_url_source
-      env_args+=("-e ANTORA_UI_BUNDLE_URL=${url_source_value}")
+      ui_bundle_zip_url="$(pwd)/site-ui/build/ui-bundle.zip"
     fi
+    local url_source_name=$(rev <<< "${ui_bundle_zip_url}" | cut -d'/' -f1 | 
rev)
+    local url_source_value="${ui_bundle_zip_url}"
+    set_antora_url_source
+    env_args+=("-e ANTORA_UI_BUNDLE_URL=${url_source_value}")
   fi
 
   env_args+=("-e 
COMMIT_GENERATED_VERSION_DOCS_TO_REPOSITORY=${commit_generated_version_docs_to_repository}")
diff --git a/site-content/Dockerfile b/site-content/Dockerfile
index 73d9755..77756c4 100644
--- a/site-content/Dockerfile
+++ b/site-content/Dockerfile
@@ -42,8 +42,7 @@ RUN apt-get update && \
         git \
         make \
         ant \
-        ant-optional \
-        vim
+        ant-optional
 
 RUN pip3 install jinja2 requests
 
@@ -99,7 +98,7 @@ ENV ANTORA_CONTENT_SOURCES_CASSANDRA_WEBSITE_BRANCHES="HEAD"
 ENV ANTORA_CONTENT_SOURCES_CASSANDRA_WEBSITE_TAGS=""
 ENV ANTORA_CONTENT_SOURCES_CASSANDRA_WEBSITE_START_PATH="site-content/source"
 
-ENV 
ANTORA_UI_BUNDLE_URL="https://github.com/ianjevans/antora-ui-datastax/releases/download/v0.1oss/ui-bundle.zip";
+ENV 
ANTORA_UI_BUNDLE_URL="https://github.com/apache/cassandra-website/raw/trunk/site-ui/build/ui-bundle.zip";
 
 ENV CASSANDRA_DOWNLOADS_URL="https://downloads.apache.org/cassandra/";
 
diff --git a/site-ui/build/ui-bundle.zip b/site-ui/build/ui-bundle.zip
new file mode 100644
index 0000000..b4b0a02
Binary files /dev/null and b/site-ui/build/ui-bundle.zip differ

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

Reply via email to