This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new b4b6c28a94 Update docs
b4b6c28a94 is described below
commit b4b6c28a9427fbfeae78d9b77548c57c1fce4131
Author: James Bognar <[email protected]>
AuthorDate: Mon Dec 29 10:42:20 2025 -0500
Update docs
---
scripts/build-docs.py | 110 ++++++++++++++++++++---------
scripts/check-topic-links.py | 51 ++++++++++++--
scripts/cleanup-whitespace.py | 160 ------------------------------------------
scripts/create-mvn-site.py | 54 +++++++++++---
scripts/release-docs-stage.py | 19 +++--
scripts/release-docs.py | 77 ++++++++++++--------
scripts/start-docusaurus.py | 3 +-
7 files changed, 231 insertions(+), 243 deletions(-)
diff --git a/scripts/build-docs.py b/scripts/build-docs.py
index 96ccf24a99..e226172f26 100755
--- a/scripts/build-docs.py
+++ b/scripts/build-docs.py
@@ -46,6 +46,43 @@ import sys
from datetime import datetime
from pathlib import Path
+
+def find_master_branch_sibling(script_dir):
+ """
+ Find the master branch sibling folder.
+
+ The docs branch and master branch should be sibling folders:
+ - /git/apache/juneau/docs/
+ - /git/apache/juneau/master/
+
+ Args:
+ script_dir: Path to the scripts directory (should be in docs/scripts)
+
+ Returns:
+ Path to the master branch folder
+
+ Raises:
+ SystemExit: If the master branch sibling folder doesn't exist
+ """
+ # Get the parent of the docs folder (should be /git/apache/juneau/)
+ docs_dir = script_dir.parent # docs/
+ parent_dir = docs_dir.parent # /git/apache/juneau/
+ master_dir = parent_dir / 'master'
+
+ if not master_dir.exists():
+ print(f"ERROR: Master branch sibling folder not found at {master_dir}")
+ print(f"Expected structure:")
+ print(f" {parent_dir}/docs/ (current)")
+ print(f" {parent_dir}/master/ (missing)")
+ print("\nPlease ensure the master branch is cloned as a sibling
folder.")
+ sys.exit(1)
+
+ if not (master_dir / '.git').exists():
+ print(f"ERROR: {master_dir} exists but is not a git repository")
+ sys.exit(1)
+
+ return master_dir
+
def run_command(cmd, cwd=None, check=True, env=None):
"""Run a shell command and return the result."""
print(f"Running: {' '.join(cmd)}")
@@ -90,21 +127,21 @@ def build_docusaurus(docs_dir, staging=False):
print(" Setting SITE_URL for staging build")
run_command(['npm', 'run', 'build'], cwd=docs_dir, env=env)
-def compile_java_modules(project_root):
+def compile_java_modules(master_root):
"""Compile and install all Java modules to local repository."""
print("\n=== Compiling and installing Java modules ===")
- run_command(['mvn', 'clean', 'install', '-DskipTests'], cwd=project_root)
+ run_command(['mvn', 'clean', 'install', '-DskipTests'], cwd=master_root)
-def generate_maven_site(project_root):
+def generate_maven_site(master_root):
"""Generate Maven site."""
print("\n=== Generating Maven site ===")
- run_command(['mvn', 'site', '-DskipTests'], cwd=project_root)
+ run_command(['mvn', 'site', '-DskipTests'], cwd=master_root)
-def copy_maven_site(project_root, docs_dir):
+def copy_maven_site(master_root, docs_dir):
"""Copy Maven site to static directory (Docusaurus will copy it to
build)."""
print("\n=== Copying Maven site to static directory ===")
- source_site = Path(project_root) / 'target' / 'site'
+ source_site = Path(master_root) / 'target' / 'site'
static_dir = Path(docs_dir) / 'static'
static_site = static_dir / 'site'
@@ -122,16 +159,16 @@ def copy_maven_site(project_root, docs_dir):
shutil.copytree(source_site, static_site)
print(f"✓ Maven site copied to {static_site}")
-def verify_apidocs(project_root):
+def verify_apidocs(master_root):
"""Verify that apidocs were generated."""
print("\n=== Verifying apidocs generation ===")
- apidocs_dir = Path(project_root) / 'target' / 'site' / 'apidocs'
+ apidocs_dir = Path(master_root) / 'target' / 'site' / 'apidocs'
if not apidocs_dir.exists():
print(f"ERROR: target/site/apidocs directory not found after
generation!")
print(f"Contents of target/site:")
- site_dir = Path(project_root) / 'target' / 'site'
+ site_dir = Path(master_root) / 'target' / 'site'
if site_dir.exists():
for item in site_dir.iterdir():
print(f" {item.name}")
@@ -143,15 +180,20 @@ def verify_apidocs(project_root):
file_count = sum(1 for _ in apidocs_dir.rglob('*.html'))
print(f"✓ Found {file_count} HTML files in apidocs")
-def get_current_release(project_root):
- """Get current release version using current-release.py script."""
+def get_current_release(master_root):
+ """Get current release version using current-release.py script from master
branch."""
script_dir = Path(__file__).parent
- current_release_script = script_dir / 'current-release.py'
+ master_scripts_dir = master_root / 'scripts'
+ current_release_script = master_scripts_dir / 'current-release.py'
+
+ if not current_release_script.exists():
+ print(f"WARNING: current-release.py not found at
{current_release_script}")
+ return None
try:
result = subprocess.run(
[sys.executable, str(current_release_script)],
- cwd=project_root,
+ cwd=master_root,
capture_output=True,
text=True,
check=True
@@ -161,17 +203,17 @@ def get_current_release(project_root):
print(f"WARNING: Could not get current release: {e}")
return None
-def copy_current_javadocs(project_root, docs_dir):
+def copy_current_javadocs(master_root, docs_dir):
"""Copy current javadocs to versioned folder and update JSON index."""
print("\n=== Copying current javadocs to versioned folder ===")
# Get current release version
- current_version = get_current_release(project_root)
+ current_version = get_current_release(master_root)
if not current_version:
print("WARNING: Could not determine current version, skipping javadocs
copy")
return
- source_apidocs = Path(project_root) / 'target' / 'site' / 'apidocs'
+ source_apidocs = Path(master_root) / 'target' / 'site' / 'apidocs'
javadocs_dir = Path(docs_dir) / 'static' / 'javadocs'
versioned_javadocs = javadocs_dir / current_version
@@ -250,16 +292,20 @@ def update_javadocs_json(docs_dir, current_version):
except Exception as e:
print(f"Warning: Could not save releases.json: {e}")
-def check_topic_links(project_root):
+def check_topic_links(master_root, docs_dir):
"""Run the topic link checker to validate documentation links."""
print("\n=== Checking topic links ===")
- checker_script = Path(project_root) / 'scripts' / 'check-topic-links.py'
+ # Use the checker script from docs/scripts (it's already there)
+ script_dir = Path(__file__).parent
+ checker_script = script_dir / 'check-topic-links.py'
if not checker_script.exists():
print(f"WARNING: Topic link checker not found at {checker_script}")
return
- run_command(['python3', str(checker_script)], cwd=project_root)
+ # The checker script needs both master_root and docs_dir
+ # It will scan master_root for links and docs_dir for topics
+ run_command(['python3', str(checker_script)], cwd=docs_dir)
def main():
parser = argparse.ArgumentParser(description='Build Apache Juneau
documentation')
@@ -270,19 +316,19 @@ def main():
args = parser.parse_args()
- # Determine project root (parent of scripts directory)
+ # Determine script directory and find master branch sibling
script_dir = Path(__file__).parent.absolute()
- project_root = script_dir.parent
- docs_dir = project_root / 'docs'
+ docs_dir = script_dir.parent # docs/
+ master_root = find_master_branch_sibling(script_dir)
- print(f"Project root: {project_root}")
+ print(f"Master branch root: {master_root}")
print(f"Docs directory: {docs_dir}")
# Check prerequisites
check_prerequisites()
- # Change to project root
- os.chdir(project_root)
+ # Change to docs directory for npm operations
+ os.chdir(docs_dir)
# Delete build directory to ensure fresh build
build_dir = Path(docs_dir) / 'build'
@@ -302,12 +348,12 @@ def main():
# Generate Maven site and javadocs (must be done before building
Docusaurus)
# Note: Aggregate javadocs are now generated automatically as part of
mvn site via the reporting section
if not args.skip_maven:
- compile_java_modules(project_root)
- generate_maven_site(project_root)
- verify_apidocs(project_root)
+ compile_java_modules(master_root)
+ generate_maven_site(master_root)
+ verify_apidocs(master_root)
# Copy current javadocs to versioned folder
- copy_current_javadocs(project_root, docs_dir)
+ copy_current_javadocs(master_root, docs_dir)
else:
print("\n=== Skipping Maven steps ===")
@@ -316,7 +362,7 @@ def main():
# Note: javadocs are already in static/javadocs, so no copy needed
if not args.skip_copy:
# Copy Maven site to static directory
- copy_maven_site(project_root, docs_dir)
+ copy_maven_site(master_root, docs_dir)
else:
print("\n=== Skipping copy step ===")
@@ -329,13 +375,13 @@ def main():
# Copy .asf.yaml to build directory (needed for deployment)
if not args.skip_copy:
build_dir = Path(docs_dir) / 'build'
- asf_yaml = Path(project_root) / '.asf.yaml'
+ asf_yaml = Path(master_root) / '.asf.yaml'
if asf_yaml.exists() and build_dir.exists():
print(f"\n=== Copying .asf.yaml to build directory ===")
shutil.copy2(asf_yaml, build_dir)
# Check topic links (runs once at the end)
- check_topic_links(project_root)
+ check_topic_links(master_root, docs_dir)
print("\n=== Documentation build complete ===")
print(f"Documentation is available in: {docs_dir / 'build'}")
diff --git a/scripts/check-topic-links.py b/scripts/check-topic-links.py
index 6630e6969d..6924907b06 100755
--- a/scripts/check-topic-links.py
+++ b/scripts/check-topic-links.py
@@ -149,16 +149,53 @@ def check_links(links, topics):
return warnings
+def find_master_branch_sibling(script_dir):
+ """
+ Find the master branch sibling folder.
+
+ The docs branch and master branch should be sibling folders:
+ - /git/apache/juneau/docs/
+ - /git/apache/juneau/master/
+
+ Args:
+ script_dir: Path to the scripts directory (should be in docs/scripts)
+
+ Returns:
+ Path to the master branch folder
+
+ Raises:
+ SystemExit: If the master branch sibling folder doesn't exist
+ """
+ # Get the parent of the docs folder (should be /git/apache/juneau/)
+ docs_dir = script_dir.parent # docs/
+ parent_dir = docs_dir.parent # /git/apache/juneau/
+ master_dir = parent_dir / 'master'
+
+ if not master_dir.exists():
+ print(f"ERROR: Master branch sibling folder not found at {master_dir}")
+ print(f"Expected structure:")
+ print(f" {parent_dir}/docs/ (current)")
+ print(f" {parent_dir}/master/ (missing)")
+ print("\nPlease ensure the master branch is cloned as a sibling
folder.")
+ sys.exit(1)
+
+ if not (master_dir / '.git').exists():
+ print(f"ERROR: {master_dir} exists but is not a git repository")
+ sys.exit(1)
+
+ return master_dir
+
+
def main():
- # Get the script directory (should be /juneau/scripts)
+ # Get the script directory (should be in docs/scripts)
script_dir = Path(__file__).parent
- juneau_root = script_dir.parent
- docs_dir = juneau_root / "docs"
+ docs_dir = script_dir.parent # docs/
+ master_root = find_master_branch_sibling(script_dir)
print("Juneau Topic Link Checker")
print("=" * 50)
- # Extract topic information
+ # Extract topic information from docs
print("\nExtracting topic information from docs...")
topics = extract_topic_info(docs_dir)
@@ -168,9 +205,9 @@ def main():
print(f"\nFound {len(topics)} topics")
- # Find all topic links
- print("\nScanning source tree for topic links...")
- links = find_topic_links(juneau_root)
+ # Find all topic links in master branch
+ print("\nScanning master branch source tree for topic links...")
+ links = find_topic_links(master_root)
print(f"Found {len(links)} topic links")
diff --git a/scripts/cleanup-whitespace.py b/scripts/cleanup-whitespace.py
deleted file mode 100755
index 9a7fa9945b..0000000000
--- a/scripts/cleanup-whitespace.py
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/usr/bin/env python3
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""
-Cleans up whitespace inconsistencies in Java files:
-- Converts leading 4-spaces to tabs
-- Removes consecutive blank lines (max 1 blank line allowed)
-- Removes trailing whitespace from lines
-- Removes blank lines before the final closing brace
-- Ensures file ends with "}" with no trailing newline
-"""
-
-import os
-import sys
-import re
-from pathlib import Path
-
-
-def clean_java_file(file_path):
- """
- Clean whitespace issues in a Java file.
- Returns True if file was modified, False otherwise.
- """
- try:
- with open(file_path, 'r', encoding='utf-8') as f:
- content = f.read()
-
- original_content = content
- lines = content.splitlines(keepends=True)
-
- # Step 1: Convert leading 4-spaces to tabs
- converted_lines = []
- for line in lines:
- if line.strip(): # Only process non-empty lines
- # Count leading spaces
- leading_spaces = len(line) - len(line.lstrip(' '))
- if leading_spaces > 0:
- # Calculate number of tabs (groups of 4 spaces)
- num_tabs = leading_spaces // 4
- remaining_spaces = leading_spaces % 4
- # Reconstruct line with tabs
- rest_of_line = line[leading_spaces:]
- line = '\t' * num_tabs + ' ' * remaining_spaces +
rest_of_line
- converted_lines.append(line)
- lines = converted_lines
-
- # Step 2: Remove trailing whitespace from each line
- lines = [line.rstrip() + ('\n' if line.endswith('\n') else '') for
line in lines]
-
- # Step 3: Remove consecutive blank lines (keep max 1)
- cleaned_lines = []
- prev_blank = False
- for line in lines:
- is_blank = line.strip() == ''
- if is_blank and prev_blank:
- # Skip consecutive blank line
- continue
- cleaned_lines.append(line)
- prev_blank = is_blank
-
- # Step 4: Remove blank lines before final closing brace
- # Find the last non-empty line
- while cleaned_lines and cleaned_lines[-1].strip() == '':
- cleaned_lines.pop()
-
- # Now remove any blank lines right before the final '}'
- # Work backwards from the end
- if cleaned_lines:
- # Find the last closing brace
- last_line_idx = len(cleaned_lines) - 1
- if cleaned_lines[last_line_idx].strip() == '}':
- # Remove blank lines before this closing brace
- idx = last_line_idx - 1
- while idx >= 0 and cleaned_lines[idx].strip() == '':
- cleaned_lines.pop(idx)
- idx -= 1
-
- # Step 5: Remove trailing newline after final }
- new_content = ''.join(cleaned_lines)
- # Remove any trailing newlines
- new_content = new_content.rstrip('\n')
- # Ensure we end with at least the closing brace (no newline after it)
- if new_content and not new_content.endswith('}'):
- # This shouldn't happen for valid Java files, but just in case
- new_content += '\n'
-
- # Check if content changed
- if new_content != original_content:
- with open(file_path, 'w', encoding='utf-8') as f:
- f.write(new_content)
- return True
-
- return False
-
- except Exception as e:
- print(f"Error processing {file_path}: {e}", file=sys.stderr)
- return False
-
-
-def find_java_files(root_dir):
- """
- Find all .java files in the given directory recursively.
- Excludes target/ and .git/ directories.
- """
- java_files = []
- root_path = Path(root_dir)
-
- for java_file in root_path.rglob('*.java'):
- # Skip target and .git directories
- if 'target' in java_file.parts or '.git' in java_file.parts:
- continue
- java_files.append(java_file)
-
- return java_files
-
-
-def main():
- """
- Main entry point for the script.
- """
- if len(sys.argv) > 1:
- root_dir = sys.argv[1]
- else:
- # Default to parent directory of this script (assumes script is in
/juneau/scripts)
- script_dir = Path(__file__).parent
- root_dir = script_dir.parent
-
- print(f"Scanning for Java files in: {root_dir}")
- java_files = find_java_files(root_dir)
- print(f"Found {len(java_files)} Java files")
-
- modified_count = 0
- for java_file in java_files:
- if clean_java_file(java_file):
- modified_count += 1
- print(f"✓ Cleaned: {java_file}")
-
- print(f"\nSummary:")
- print(f" Total files scanned: {len(java_files)}")
- print(f" Files modified: {modified_count}")
- print(f" Files unchanged: {len(java_files) - modified_count}")
-
-
-if __name__ == '__main__':
- main()
-
diff --git a/scripts/create-mvn-site.py b/scripts/create-mvn-site.py
index dfcc126b72..76ff54c1ed 100755
--- a/scripts/create-mvn-site.py
+++ b/scripts/create-mvn-site.py
@@ -81,12 +81,49 @@ def run_maven_command(command, description, cwd):
return False
-def get_project_version(juneau_root):
+def find_master_branch_sibling(script_dir):
+ """
+ Find the master branch sibling folder.
+
+ The docs branch and master branch should be sibling folders:
+ - /git/apache/juneau/docs/
+ - /git/apache/juneau/master/
+
+ Args:
+ script_dir: Path to the scripts directory (should be in docs/scripts)
+
+ Returns:
+ Path to the master branch folder
+
+ Raises:
+ SystemExit: If the master branch sibling folder doesn't exist
+ """
+ # Get the parent of the docs folder (should be /git/apache/juneau/)
+ docs_dir = script_dir.parent # docs/
+ parent_dir = docs_dir.parent # /git/apache/juneau/
+ master_dir = parent_dir / 'master'
+
+ if not master_dir.exists():
+ print(f"ERROR: Master branch sibling folder not found at {master_dir}")
+ print(f"Expected structure:")
+ print(f" {parent_dir}/docs/ (current)")
+ print(f" {parent_dir}/master/ (missing)")
+ print("\nPlease ensure the master branch is cloned as a sibling
folder.")
+ sys.exit(1)
+
+ if not (master_dir / '.git').exists():
+ print(f"ERROR: {master_dir} exists but is not a git repository")
+ sys.exit(1)
+
+ return master_dir
+
+
+def get_project_version(master_root):
"""Get the project version from Maven POM."""
try:
result = subprocess.run(
["mvn", "help:evaluate", "-Dexpression=project.version", "-q",
"-DforceStdout"],
- cwd=juneau_root,
+ cwd=master_root,
capture_output=True,
text=True,
check=True
@@ -100,16 +137,17 @@ def get_project_version(juneau_root):
def main():
# Get directories
script_dir = Path(__file__).parent
- juneau_root = script_dir.parent
- docs_dir = juneau_root / "docs"
- site_dir = juneau_root / "target" / "site"
+ docs_dir = script_dir.parent # docs/
+ master_root = find_master_branch_sibling(script_dir)
+ site_dir = master_root / "target" / "site"
static_site_dir = docs_dir / "static" / "site"
print("Creating Maven site with javadocs for local testing...")
- print(f"Working from: {juneau_root}")
+ print(f"Master branch: {master_root}")
+ print(f"Docs directory: {docs_dir}")
# Get project version
- project_version = get_project_version(juneau_root)
+ project_version = get_project_version(master_root)
print(f"Detected project version: {project_version}")
# Generate Maven site
@@ -124,7 +162,7 @@ def main():
if not run_maven_command(
["mvn", "clean", "compile", "site"],
"Running Maven site generation...",
- juneau_root
+ master_root
):
fail_with_message("Maven site generation failed")
diff --git a/scripts/release-docs-stage.py b/scripts/release-docs-stage.py
index 49e701c99b..7006fa4669 100755
--- a/scripts/release-docs-stage.py
+++ b/scripts/release-docs-stage.py
@@ -173,8 +173,7 @@ def main():
args = parser.parse_args()
script_dir = Path(__file__).parent
- project_root = script_dir.parent
- docs_dir = project_root / 'docs'
+ docs_dir = script_dir.parent # docs/
build_dir = docs_dir / 'build'
print("=" * 79)
@@ -192,7 +191,7 @@ def main():
if not run_command(
[sys.executable, str(build_script), '--staging'],
- cwd=project_root,
+ cwd=docs_dir,
description="Building documentation for staging"
):
print("\n❌ Documentation build failed. Aborting.")
@@ -215,10 +214,20 @@ def main():
play_sound(success=False)
sys.exit(1)
- # Use sibling directory instead of temp directory
- staging_dir = project_root.parent / 'juneau-asf-staging'
+ # Use sibling directory structure: /git/apache/juneau/asf-staging
+ parent_dir = docs_dir.parent # /git/apache/juneau/
+ staging_dir = parent_dir / 'asf-staging'
print(f"Staging directory: {staging_dir}")
+ # Verify parent directory structure
+ if not parent_dir.exists():
+ print(f"❌ ERROR: Parent directory not found: {parent_dir}")
+ print("Expected structure:")
+ print(f" {parent_dir}/docs/ (current)")
+ print(f" {parent_dir}/asf-staging/ (will be created)")
+ play_sound(success=False)
+ sys.exit(1)
+
try:
# Check if directory already exists
if staging_dir.exists() and (staging_dir / '.git').exists():
diff --git a/scripts/release-docs.py b/scripts/release-docs.py
index d7534480da..bc1f2d2f26 100755
--- a/scripts/release-docs.py
+++ b/scripts/release-docs.py
@@ -33,10 +33,8 @@ Options:
import argparse
import os
import platform
-import shutil
import subprocess
import sys
-import tempfile
from pathlib import Path
@@ -168,7 +166,7 @@ def main():
args = parser.parse_args()
script_dir = Path(__file__).parent
- project_root = script_dir.parent
+ docs_dir = script_dir.parent # docs/
print("=" * 79)
print("Promote Documentation to Production (asf-site branch)")
@@ -184,23 +182,51 @@ def main():
print("❌ ERROR: Could not determine git remote URL")
sys.exit(1)
- # Create temp directory
- temp_dir = Path(tempfile.mkdtemp(prefix='docs-promote-'))
- print(f"Temporary directory: {temp_dir}")
+ # Use sibling directory structure: /git/apache/juneau/asf-site
+ parent_dir = docs_dir.parent # /git/apache/juneau/
+ site_dir = parent_dir / 'asf-site'
+ print(f"Site directory: {site_dir}")
+
+ # Verify parent directory structure
+ if not parent_dir.exists():
+ print(f"❌ ERROR: Parent directory not found: {parent_dir}")
+ print("Expected structure:")
+ print(f" {parent_dir}/docs/ (current)")
+ print(f" {parent_dir}/asf-site/ (will be created)")
+ sys.exit(1)
try:
- # Step 1: Clone repository to temp directory
- if not run_command(
- ["git", "clone", remote_url, str(temp_dir)],
- description="Cloning repository to temp directory"
- ):
- print("\n❌ Failed to clone repository")
- sys.exit(1)
+ # Step 1: Setup sibling directory with asf-site branch
+ print("\nStep 1: Setting up sibling directory with asf-site branch...")
+
+ # Check if directory already exists
+ if site_dir.exists() and (site_dir / '.git').exists():
+ # Directory exists and is a git repo, update it
+ print("📁 Site directory already exists, updating...")
+ if not run_command(
+ ["git", "fetch", "origin"],
+ cwd=site_dir,
+ description="Fetching latest changes"
+ ):
+ print("\n❌ Failed to fetch latest changes")
+ sys.exit(1)
+ else:
+ # Directory doesn't exist or isn't a git repo, clone it
+ if site_dir.exists():
+ print(f"⚠️ Directory exists but is not a git repository.
Removing: {site_dir}")
+ shutil.rmtree(site_dir)
+
+ if not run_command(
+ ["git", "clone", remote_url, str(site_dir)],
+ description="Cloning repository to site directory"
+ ):
+ print("\n❌ Failed to clone repository")
+ sys.exit(1)
# Step 2: Fetch asf-staging branch
if not run_command(
["git", "fetch", "origin", "asf-staging"],
- cwd=temp_dir,
+ cwd=site_dir,
description="Fetching asf-staging branch"
):
print("\n❌ Failed to fetch asf-staging branch")
@@ -209,7 +235,7 @@ def main():
# Step 3: Switch to detached HEAD at origin/asf-staging
if not run_command(
["git", "switch", "--detach", "origin/asf-staging"],
- cwd=temp_dir,
+ cwd=site_dir,
description="Switching to detached HEAD at origin/asf-staging"
):
print("\n❌ Failed to switch to asf-staging branch")
@@ -236,12 +262,12 @@ def main():
run_command(
["git", "config", "user.name", git_user],
- cwd=temp_dir,
+ cwd=site_dir,
description="Setting git user name"
)
run_command(
["git", "config", "user.email", git_email],
- cwd=temp_dir,
+ cwd=site_dir,
description="Setting git user email"
)
@@ -250,24 +276,23 @@ def main():
print("\nStep 5: Pushing to remote asf-site branch...")
if not run_command(
["git", "push", "origin", "HEAD:asf-site", "--force"],
- cwd=temp_dir,
+ cwd=site_dir,
description="Pushing to asf-site branch"
):
print("\n❌ Failed to push to asf-site branch")
sys.exit(1)
else:
print("\n⏭️ Skipping push (--no-push flag set)")
- print(f" Changes are ready in: {temp_dir}")
+ print(f" Changes are ready in: {site_dir}")
print(" You can manually push with:")
- print(f" cd {temp_dir}")
+ print(f" cd {site_dir}")
print(" git push origin HEAD:asf-site --force")
print("\n" + "=" * 79)
print("✅ Documentation promotion to production complete!")
print("=" * 79)
- if args.no_push:
- print(f"\nTemporary directory: {temp_dir}")
- print("(This directory will not be automatically cleaned up)")
+ print(f"\nSite directory: {site_dir}")
+ print("(This directory is persistent and will be reused for future
deployments)")
# Play success sound
play_sound(success=True)
@@ -280,12 +305,6 @@ def main():
import traceback
traceback.print_exc()
sys.exit(1)
- finally:
- # Clean up temp directory if push was successful
- if not args.no_push and temp_dir.exists():
- print(f"\nCleaning up temporary directory: {temp_dir}")
- shutil.rmtree(temp_dir)
- print("✅ Cleanup complete")
if __name__ == '__main__':
diff --git a/scripts/start-docusaurus.py b/scripts/start-docusaurus.py
index 78de61e53e..185261859d 100755
--- a/scripts/start-docusaurus.py
+++ b/scripts/start-docusaurus.py
@@ -105,8 +105,7 @@ def clear_caches(docs_dir):
def main():
# Get directories
script_dir = Path(__file__).parent
- juneau_root = script_dir.parent
- docs_dir = juneau_root / "docs"
+ docs_dir = script_dir.parent # docs/
print_step("🔄 Starting Docusaurus server...")
print_step(f"📁 Working directory: {docs_dir}")