Merge pull request #424 from hellmarbecker/20231019-articles-hellmarblog
diff --git a/README.md b/README.md
index 4120403..f826879 100644
--- a/README.md
+++ b/README.md
@@ -41,15 +41,15 @@
These are the steps to publish either a new release or a hotfix to an existing release. Note that you'll always need to build `latest` so that the downloads page lists the correct versions, so the script automatically builds latest for you.
-> Note that the build scripts expect `apache/druid` and `apache/druid-website-src` to be peers at the same directory level.
+Before you start:
+* Make sure you're on the correct branch in your apache/druid repo.
+* Get the path of the apache/druid repo. You can skip this if you have `apache/druid` and `apache/druid-website-src` as peers at the same directory level.
1. Update the version list in `static/js/version.js`. The highest release version goes in position 0. This file is used by `RecentReleasesWidget` on the home page to display the 3 most recent versions and to interpolate the download links on the download page.
2. From the root of `druid-website-src`, go to `scripts/`.
-3. In `copy_druid_docs.py`, set `source_directory` to your OSS Druid repo. Make sure you're on the correct branch in your Druid repo before continuing.
-
-4. In `scripts`, run `python do_all_things.py -v VERSION`. The script assumes you used `npm` to install. See example 3 if you use `yarn`.
+3. In `scripts`, run `python do_all_things.py -v VERSION`. The script assumes you used `npm` to install. See example 3 if you use `yarn`.
**Example 1**: This command builds version 27.0.0 of the docs and latest.
@@ -69,8 +69,7 @@
python do_all_things.py -v 27.0.0 --yarn
```
- **Example 4**: If you have apache/druid in a completely different place (see note above), specify it using the `--source` flag.
-
+ **Example 4**: If you have apache/druid in different place from druid-website-src, or use a different directory name than `druid`, specify its path using the `--source` flag.
```
python do_all_things.py -v 27.0.0 --source /my/path/to/apache/druid
@@ -88,11 +87,11 @@
The versions you built (such as 26.0.0 and latest) are copied to `published_versions` where the compiled pages for the older docs live.
-5. Go to `published_versions` and verify the site. If you run it locally, such as with `http-server` you'll get the latest version of the site, such as `localhost:8080/docs/latest/` and the version you built, such as `localhost:8080/docs/26.0.0/`. In addition, you should be able to see pre-Docusaurus2 versions such as 25.0.0 with the old CSS.
+4. Go to `published_versions` and verify the site. If you run it locally, such as with `http-server` you'll get the latest version of the site, such as `localhost:8080/docs/latest/` and the version you built, such as `localhost:8080/docs/26.0.0/`. In addition, you should be able to see pre-Docusaurus2 versions such as 25.0.0 with the old CSS.
-6. Commit the built files along with the Markdown files to `druid-website-src` and make a PR.
+5. Commit the built files along with the Markdown files to `druid-website-src` and make a PR.
-7. Use the contents of `published_versions` to make a PR to `https://github.com/apache/druid-website` (either the `asf-staging` branch or the `asf-site` branch).
+6. Use the contents of `published_versions` to make a PR to `https://github.com/apache/druid-website` (either the `asf-staging` branch or the `asf-site` branch).
### The scripts
diff --git a/scripts/build_docs.py b/scripts/build_docs.py
index 0400574..2454349 100644
--- a/scripts/build_docs.py
+++ b/scripts/build_docs.py
@@ -4,7 +4,7 @@
"""
build-docs.py
-Version: 6 June 2023
+Version: 19 Oct 2023
Purpose: Build the OSS Druid Docusaurus 2 docs for all
versions supplied in the [-v, --versions] flag.
@@ -28,6 +28,10 @@
def build_docs(versions, use_yarn):
+ # define the folders that Docusaurus builds into and a temporary one
+ build_dir = "build"
+ temp_dir = "build__temp"
+
for v in versions:
print(f"Building the docs for version '{v}'...")
@@ -40,7 +44,10 @@
replacement = f'var buildVersion = "{v}";'
for line in fileinput.input("docusaurus.config.js", inplace=1):
print(re.sub(r"^var buildVersion.*", replacement, line), end='')
- shutil.rmtree(f"published_versions/docs/{v}", ignore_errors=True)
+
+ # remove specific version folder in published_versions/docs if exists
+ shutil.rmtree(f"published_versions/docs/{v}", ignore_errors=True)
+
# build the docs
if not use_yarn:
subprocess.run(["npm", "run", "build"])
@@ -51,11 +58,9 @@
# overwrites build directory with each build.
# the "latest" version is built last to maintain
# all the non-docs content for latest
- source_dir = "build"
- destination_dir = "build__temp"
- if not os.path.isdir(source_dir):
+ if not os.path.isdir(build_dir):
sys.exit("ERROR: The docs were not built. Check Docusaurus logs.")
- shutil.copytree(source_dir, destination_dir, dirs_exist_ok=True)
+ shutil.copytree(build_dir, temp_dir, dirs_exist_ok=True)
# restore the redirect file back to URLs with "latest"
#subprocess.run(["git", "restore", "redirects.js"])
@@ -63,13 +68,25 @@
for line in fileinput.input("redirects.js", inplace=1):
print(line.replace(f"/{v}/", "/latest/"), end='')
- # after all version builds, rename the temp directory back to "build"
- shutil.rmtree(source_dir)
- shutil.move(destination_dir, source_dir)
+ # save the assets folder to check into GitHub
+ # applies to EACH version, since Doc2 attaches an alphanumeric string
+ # to each asset; so you can't republish an old version unless you
+ # also have the associated assets
+ shutil.copytree(f"{build_dir}/assets", 'published_versions/assets', dirs_exist_ok=True)
+
+
+ # after building ALL versions, rename the temp directory back to "build"
+ shutil.rmtree(build_dir)
+ shutil.move(temp_dir, build_dir)
+
+ # save the final build output to check into GitHub
+ print("Copying build output to ../published_versions. Use that directory to publish the site.")
+ shutil.copytree(build_dir, 'published_versions', dirs_exist_ok=True)
+
def main(versions, skip_install, use_yarn):
- # from druid-website-src/static/build-scripts,
+ # from druid-website-src/scripts,
# move to druid-website-src to run the npm commands
os.chdir("../")
@@ -87,6 +104,7 @@
# remove the old build directory
shutil.rmtree('build', ignore_errors=True)
+
# do the actual builds
build_docs(versions, use_yarn)
diff --git a/scripts/do_all_things.py b/scripts/do_all_things.py
index e7574f8..519f5d3 100644
--- a/scripts/do_all_things.py
+++ b/scripts/do_all_things.py
@@ -1,6 +1,5 @@
import copy_druid_docs
import build_docs
-import shutil
# Example: python do_all_things.py -v 26.0.0
@@ -17,9 +16,6 @@
else:
build_docs.main(["latest"], skip_install, use_yarn)
- print("Copying build output to ../published_versions. Use that directory to publish the site.")
- shutil.copytree('build','published_versions', dirs_exist_ok=True)
-
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
diff --git a/src/pages/downloads.mdx b/src/pages/downloads.mdx
index d7190bf..57e7247 100644
--- a/src/pages/downloads.mdx
+++ b/src/pages/downloads.mdx
@@ -23,9 +23,7 @@
<li>Release date: {Releases[0].date}</li>
<li>Binary download: <a href={ `https://www.apache.org/dyn/closer.cgi?path=/druid/${Releases[0].version}/apache-druid-${Releases[0].version}-bin.tar.gz`}>apache-druid-{Releases[0].version}-bin.tar.gz</a> (<a href={ `https://www.apache.org/dist/druid/${Releases[0].version}/apache-druid-${Releases[0].version}-bin.tar.gz.sha512`}>sha512</a>, <a href={ `https://www.apache.org/dist/druid/${Releases[0].version}/apache-druid-${Releases[0].version}-bin.tar.gz.asc`}>pgp</a>)</li>
<li>Source download: <a href={ `https://www.apache.org/dyn/closer.cgi?path=/druid/${Releases[0].version}/apache-druid-${Releases[0].version}-src.tar.gz`}>apache-druid-{Releases[0].version}-bin.tar.gz</a> (<a href={ `https://www.apache.org/dist/druid/${Releases[0].version}/apache-druid-${Releases[0].version}-src.tar.gz.sha512`}>sha512</a>, <a href={ `https://www.apache.org/dist/druid/${Releases[0].version}/apache-druid-${Releases[0].version}-src.tar.gz.asc`}>pgp</a>)</li>
-<li>Hadoop3 compatible artifacts (use these only if you use Hadoop3 with your Druid cluster):
- <ul><li>Binary download: <a href={ `https://www.apache.org/dyn/closer.cgi?path=/druid/${Releases[0].version}/apache-druid-${Releases[0].version}-hadoop3-bin.tar.gz`}>apache-druid-{Releases[0].version}-bin.tar.gz</a> (<a href={ `https://www.apache.org/dist/druid/${Releases[0].version}/apache-druid-${Releases[0].version}-hadoop3-bin.tar.gz.sha512`}>sha512</a>, <a href={ `https://www.apache.org/dist/druid/${Releases[0].version}/apache-druid-${Releases[0].version}-hadoop3-bin.tar.gz.asc`}>pgp</a>)</li></ul>
- </li>
+
<li>Release notes: <a href={ `https://github.com/apache/druid/releases/tag/druid-${Releases[0].version}`}>{Releases[0].version}</a></li>
</ul>
diff --git a/src/pages/index.js b/src/pages/index.js
index 00647c6..d02847b 100644
--- a/src/pages/index.js
+++ b/src/pages/index.js
@@ -34,15 +34,15 @@
<div className="container">
<div className="text-center">
<h4>
- Druid Summit 2023 - Call for Speakers is now open!{' '}
+ Registration is now open!{' '}
<a
href="http://druidsummit.org/"
target="_blank"
rel="noopener noreferrer"
>
- Apply to speak
+ Register today
</a>{' '}
- by October 13th.
+ for virtual Druid Summit on December 6th.
</h4>
</div>
</div>