Compare commits

..

No commits in common. "b0f104927cccefb91afe2ffc33f7cff27e6d1954" and "809f2a8949fabaa14bf35bc9b8fb472d03ae71a3" have entirely different histories.

8 changed files with 23 additions and 51 deletions

View File

@ -25,19 +25,22 @@ gradle test
Build distribution package:
```bash
gradle build
# Creates jrunner/build/distributions/jrunner.zip
# Creates app/build/distributions/app.zip
```
Deploy to /opt (as documented in readme.md):
```bash
sudo unzip jrunner/build/distributions/jrunner.zip -d /opt/
sudo ln -sf /opt/jrunner/bin/jrunner /usr/local/bin/jrunner
sudo cp app/build/distributions/app.zip /opt/
sudo rm -rf /opt/app/
sudo unzip /opt/app.zip -d /opt/
sudo rm /opt/app.zip
sudo chown ptrowbridge:ptrowbridge -R /opt/app/
```
## Architecture
### Single-File Design
The entire application logic resides in `jrunner/src/main/java/jrunner/jrunner.java`. This is a monolithic command-line tool with no abstraction layers or separate modules.
The entire application logic resides in `app/src/main/java/jrunner/jrunner.java`. This is a monolithic command-line tool with no abstraction layers or separate modules.
### Data Flow
1. Parse command-line arguments (-scu, -scn, -scp for source; -dcu, -dcn, -dcp for destination)
@ -52,7 +55,7 @@ The entire application logic resides in `jrunner/src/main/java/jrunner/jrunner.j
The tool includes explicit handling for different SQL data types in a switch statement (lines 229-312). Supported types include VARCHAR, TEXT, CHAR, CLOB, DATE, TIME, TIMESTAMP, and BIGINT. String types get quote escaping and optional trimming.
### Database Drivers
JDBC drivers are configured in `jrunner/build.gradle`:
JDBC drivers are configured in `app/build.gradle`:
- PostgreSQL: org.postgresql:postgresql:42.5.0
- IBM AS/400 (JT400): net.sf.jt400:jt400:11.0
- Microsoft SQL Server: com.microsoft.sqlserver:mssql-jdbc:9.2.0.jre8

6
copy_to_apt.sh Executable file
View File

@ -0,0 +1,6 @@
sudo cp app/build/distributions/app.zip /opt/
sudo rm -rf /opt/app/
sudo unzip /opt/app.zip -d /opt/
sudo rm /opt/app.zip
sudo chown $USER:$USER -R /opt/app/
export JR="/opt/app/bin/app"

View File

@ -1,23 +0,0 @@
#!/bin/bash
set -e
# Default deployment directory
DEPLOY_DIR="${1:-/opt/jrunner}"
echo "Building jrunner..."
./gradlew build
echo "Deploying to ${DEPLOY_DIR}..."
sudo rm -rf "${DEPLOY_DIR}"
sudo unzip jrunner/build/distributions/jrunner.zip -d "$(dirname "${DEPLOY_DIR}")"
# Only create symlink for default location
if [ "${DEPLOY_DIR}" = "/opt/jrunner" ]; then
echo "Creating symlink..."
sudo ln -sf /opt/jrunner/bin/jrunner /usr/local/bin/jrunner
echo "✅ Deployment complete!"
echo "Run 'jrunner --help' to test"
else
echo "✅ Deployment complete!"
echo "Run '${DEPLOY_DIR}/bin/jrunner --help' to test"
fi

View File

@ -36,34 +36,20 @@ cd jrunner
./gradlew build
```
## deploy
### using the deploy script (recommended)
## deploy system-wide
```
# Deploy to /opt/jrunner (default, creates system-wide symlink)
./deploy.sh
# Deploy to custom location (for testing, no symlink)
./deploy.sh /opt/jrunner-test
sudo unzip app/build/distributions/app.zip -d /opt/
sudo ln -sf /opt/app/bin/app /usr/local/bin/jrunner
```
The script builds and deploys in one step. When deploying to the default location (`/opt/jrunner`), it creates a symlink at `/usr/local/bin/jrunner` so you can run `jrunner` from anywhere.
### manual deployment
```
./gradlew build
sudo unzip jrunner/build/distributions/jrunner.zip -d /opt/
sudo ln -sf /opt/jrunner/bin/jrunner /usr/local/bin/jrunner
```
## usage
After deployment to default location:
Now you can run from anywhere:
```
jrunner -scu jdbc:postgresql://... -scn user -scp pass ...
```
After deployment to custom location:
To update after rebuilding:
```
/opt/jrunner-test/bin/jrunner -scu jdbc:postgresql://... -scn user -scp pass ...
./gradlew build
sudo rm -rf /opt/app
sudo unzip app/build/distributions/app.zip -d /opt/
```

View File

@ -8,4 +8,4 @@
*/
rootProject.name = 'jrunner'
include('jrunner')
include('app')