push.py
push.py automates the complete build, test, and deployment workflow for Juneau, ensuring code quality before pushing changes to the remote repository.
What It Does
The script executes the following steps in order:
- Run Tests - Executes
mvn testto ensure all tests pass (optional with--skip-tests) - Build and Install - Runs
mvn clean package installto build the project - Git Commit - Stages all changes and commits with the provided message
- Git Push - Pushes the commit to the remote repository
If any step fails, the script stops immediately and reports the failure.
Usage
Basic Usage
cd /Users/james.bognar/git/juneau
python3 scripts/push.py "Your commit message here"
Skip Tests (for documentation-only changes)
python3 scripts/push.py "Updated README" --skip-tests
Dry Run (see what would happen without actually doing it)
python3 scripts/push.py "Testing changes" --dry-run
Command-Line Options
Required Arguments
message- The Git commit message (must be provided)
Optional Flags
--skip-tests- Skip running tests (useful for documentation-only changes)--dry-run- Show what would be done without actually executing commands
When to Use
Use the full script when:
- Making code changes that affect functionality
- Adding new features
- Fixing bugs
- Refactoring code
Use --skip-tests when:
- Only updating documentation (README, markdown files)
- Making cosmetic changes (formatting, comments)
- Tests have already been run successfully in another context
Use --dry-run when:
- Testing the script itself
- Verifying what steps will be executed
- Learning how the script works
Requirements
- Python 3.6 or higher
- Maven (mvn command must be in PATH)
- Git (git command must be in PATH)
- No external Python dependencies (uses only standard library)
Exit Codes
0- Success, all operations completed1- Failure at any step
Safety Features
- No Changes Detection - If there are no changes to commit, the script skips commit and push steps
- Fail-Fast - Stops immediately on any error to prevent incomplete deployments
- Clear Output - Each step is clearly marked with emojis and status indicators
- Dry Run Mode - Preview what will happen without making any changes
Share feedback or follow-up questions for this page directly through GitHub.