mirror of
https://github.com/apache/kafka.git
synced 2026-10-28 08:24:58 +08:00
MINOR: Stop staging LICENSE/NOTICE into kafka-site content dir (#23906)
Follow-up to KAFKA-21289 (#23833), which fixed `release.py stage-docs` for the Hugo-based kafka-site layout. The site-docs tar carries the repo's top-level `LICENSE` and `NOTICE` at its root. `stage-docs` extracts the tar with `tar xf ... --strip-components 1` straight into `content/en/<version>/`, so those two files get dumped into the kafka-site content tree alongside the actual docs. They are not docs content and do not belong there — the previous release slot (`content/en/43`) has neither, and the javadoc tree already carries its own `legal/` license files under `static/<version>/javadoc/`. This was flagged on the 4.4 kafka-site PR, where `content/en/44/LICENSE` and `content/en/44/NOTICE` showed up as spurious additions and had to be removed by hand. Without this change they return on every `stage-docs` run. This patch drops `LICENSE` and `NOTICE` from the content directory after extraction, mirroring the existing post-extraction cleanup that moves `images/` out to `static/<version>/`. No behavior change for any other staged file. Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
1 parent
dbe15eb1b7
commit
a3444d8b32
1 file changed
+8
@@ -162,6 +162,14 @@ def command_stage_docs():
|
||||
static_images_path = os.path.join(static_docs_path, "images")
|
||||
cmd("Moving images to static assets", f"mkdir -p {static_images_path} && cp -R {content_images_path}/. {static_images_path} && rm -rf {content_images_path}", shell=True)
|
||||
|
||||
# LICENSE and NOTICE sit at the root of the site-docs tar and get dumped into
|
||||
# content/en/<version> by the extract above, but they are not docs content and
|
||||
# do not belong in the kafka-site content tree. Drop them after extraction.
|
||||
for stray_file in ("LICENSE", "NOTICE"):
|
||||
stray_path = os.path.join(content_docs_path, stray_file)
|
||||
if os.path.exists(stray_path):
|
||||
cmd(f"Removing stray {stray_file}", f"rm -f {stray_path}")
|
||||
|
||||
javadocs_src_dir = os.path.join(repo_dir, "build", "docs", "javadoc")
|
||||
|
||||
cmd("Copying javadocs", f"cp -R {javadocs_src_dir} {static_docs_path}")
|
||||
|
||||
Reference in new issue
Block a user