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:
- Checks that git is configured with the ASF committer identity, and warns when the docs checkout is not on a branch or is behind its upstream
- Runs
build-docs.pywith--stagingflag to build documentation for staging - Clones (or updates) a sibling
../asf-staging/checkout - 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/buildinto it - 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")--juneau-root DIR- Juneau source checkout, passed on tobuild-docs.py(default:JUNEAU_ROOT, then a sibling../master/, then a sibling../juneau/)--console full|board|none- Console output when the live view is available (default:JUNEAU_TERMINAL_CONSOLE, thenboard)
Live View
When the Juneau checkout includes juneau-terminal, the whole run is one live view:
Prechecks (identity and branch), the rows of
build-docs.py (Clean through Links), Stage push
(fetch, copy, commit and push, with the push shown as skipped under --no-push), and URL, the staged
site. Without juneau-terminal the script prints plain output, as build-docs.py does.
Prerequisites
- Python 3.10 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 persistent sibling
../asf-staging/checkout for git operations, reused by later runs - With
--no-pushthe commit stays in../asf-staging/for manual inspection; nothing changes on the remote - 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