Windows (Primary Development Environment):
REM Instead of: git push
REM Use this:
scripts\safe-push.bat
REM Or with parameters:
scripts\safe-push.bat origin mainLinux (Server Environment):
# Instead of: git push
# Use this:
./scripts/safe-push.sh
# Or with parameters:
./scripts/safe-push.sh origin mainThis script automatically:
- Backs up your current local JNDI names
- Replaces them with environment variables
- Pushes to GitHub
- Restores your local JNDI names
Windows:
REM 1. Prepare for push (backs up and replaces JNDI names)
scripts\prepare-for-push.bat
REM 2. Push your changes
git push
REM 3. Restore local configuration
scripts\restore-local-jndi.batLinux:
# 1. Prepare for push (backs up and replaces JNDI names)
./scripts/prepare-for-push.sh
# 2. Push your changes
git push
# 3. Restore local configuration
./scripts/restore-local-jndi.shWhen asked to push changes to GitHub, Claude should AUTOMATICALLY:
-
Before pushing:
- Change current JNDI names →
${JDBC_DATASOURCE}in persistence.xml - Change current audit JNDI names →
${JDBC_AUDIT_DATASOURCE}in persistence.xml
- Change current JNDI names →
-
Push changes to GitHub
-
After pushing:
- Revert
${JDBC_DATASOURCE}→ back to the original JNDI name that was there before - Revert
${JDBC_AUDIT_DATASOURCE}→ back to the original audit JNDI name that was there before
- Revert
src/main/resources/META-INF/persistence.xml
The JNDI names change based on environment and will be manually updated:
- Examples:
jdbc/asiri,jdbc/ruhunu,jdbc/coop, etc. - Always preserve whatever the current local configuration is
NEVER commit actual JNDI names to the repository - always use environment variables in pushed commits
Use the last choice in history - whatever JNDI names are currently in the file should be restored after pushing.
Windows (Primary Development):
scripts\safe-push.bat- Complete automation (recommended)scripts\prepare-for-push.bat- Prepare persistence.xml for GitHub pushscripts\restore-local-jndi.bat- Restore local JNDI configuration
Linux (Server Environment):
scripts/safe-push.sh- Complete automation (recommended)scripts/prepare-for-push.sh- Prepare persistence.xml for GitHub pushscripts/restore-local-jndi.sh- Restore local JNDI configuration
- Scripts detect current JNDI names in persistence.xml
- Create backup files (.jndi-backup-main, .jndi-backup-audit)
- Replace with environment variables for GitHub compatibility
- After push, restore original local names from backup
- Clean up backup files
- ✅ Eliminates QA deployment blockers
- ✅ Maintains local development functionality
- ✅ Prevents manual errors
- ✅ One-command simplicity