release-docs-stage.py
release-docs-stage.py builds the documentation and deploys it to the asf-staging branch, making it available on the staging website.
What It Does
The script:
- Runs
build-docs.pywith--stagingflag to build documentation for staging - Clones the repository to a temporary directory
- Checks out the
asf-stagingbranch (or creates it if it doesn't exist) - Removes all existing files (except
.git) - Copies the built documentation from
juneau-docs/buildto the temp directory - Adds and commits the changes
- Pushes to the remote
asf-stagingbranch
Usage
Deploy to Staging
python3 scripts/release-docs-stage.py
Custom Commit Message
python3 scripts/release-docs-stage.py --commit-message "Updated API documentation"
Test Without Pushing
python3 scripts/release-docs-stage.py --no-push
Command-Line Options
--no-push- Build and commit but don't push to remote--commit-message MESSAGE- Custom commit message (default: "Deploy documentation staging")
Prerequisites
- Python 3.6 or higher
- Git (git command must be in PATH)
- All prerequisites for
build-docs.py(Node.js, npm, Maven, Java) - Write access to the remote repository
Exit Codes
0- Success1- Error occurred
Notes
- The script uses a temporary directory for git operations
- The temp directory is automatically cleaned up after successful push
- If
--no-pushis used, the temp directory is not cleaned up (for manual inspection) - The script sets
SITE_URLenvironment variable tohttps://juneau.staged.apache.orgwhen building - A success sound is played when the script completes successfully
Workflow
This script is typically used as part of the documentation release workflow:
- Make documentation changes
- Run
release-docs-stage.pyto deploy to staging - Review the staging site
- Run
release-docs.pyto promote to production
Share feedback or follow-up questions for this page directly through GitHub.