Compare commits
4 Commits
809f2a8949
...
b0f104927c
| Author | SHA1 | Date | |
|---|---|---|---|
| b0f104927c | |||
| 0ecb6860bd | |||
| c41ab99841 | |||
| 8cdd88d053 |
13
CLAUDE.md
13
CLAUDE.md
@ -25,22 +25,19 @@ gradle test
|
|||||||
Build distribution package:
|
Build distribution package:
|
||||||
```bash
|
```bash
|
||||||
gradle build
|
gradle build
|
||||||
# Creates app/build/distributions/app.zip
|
# Creates jrunner/build/distributions/jrunner.zip
|
||||||
```
|
```
|
||||||
|
|
||||||
Deploy to /opt (as documented in readme.md):
|
Deploy to /opt (as documented in readme.md):
|
||||||
```bash
|
```bash
|
||||||
sudo cp app/build/distributions/app.zip /opt/
|
sudo unzip jrunner/build/distributions/jrunner.zip -d /opt/
|
||||||
sudo rm -rf /opt/app/
|
sudo ln -sf /opt/jrunner/bin/jrunner /usr/local/bin/jrunner
|
||||||
sudo unzip /opt/app.zip -d /opt/
|
|
||||||
sudo rm /opt/app.zip
|
|
||||||
sudo chown ptrowbridge:ptrowbridge -R /opt/app/
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
### Single-File Design
|
### Single-File Design
|
||||||
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.
|
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.
|
||||||
|
|
||||||
### Data Flow
|
### Data Flow
|
||||||
1. Parse command-line arguments (-scu, -scn, -scp for source; -dcu, -dcn, -dcp for destination)
|
1. Parse command-line arguments (-scu, -scn, -scp for source; -dcu, -dcn, -dcp for destination)
|
||||||
@ -55,7 +52,7 @@ The entire application logic resides in `app/src/main/java/jrunner/jrunner.java`
|
|||||||
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.
|
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
|
### Database Drivers
|
||||||
JDBC drivers are configured in `app/build.gradle`:
|
JDBC drivers are configured in `jrunner/build.gradle`:
|
||||||
- PostgreSQL: org.postgresql:postgresql:42.5.0
|
- PostgreSQL: org.postgresql:postgresql:42.5.0
|
||||||
- IBM AS/400 (JT400): net.sf.jt400:jt400:11.0
|
- IBM AS/400 (JT400): net.sf.jt400:jt400:11.0
|
||||||
- Microsoft SQL Server: com.microsoft.sqlserver:mssql-jdbc:9.2.0.jre8
|
- Microsoft SQL Server: com.microsoft.sqlserver:mssql-jdbc:9.2.0.jre8
|
||||||
|
|||||||
@ -1,6 +0,0 @@
|
|||||||
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"
|
|
||||||
23
deploy.sh
Executable file
23
deploy.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/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
|
||||||
30
readme.md
30
readme.md
@ -36,20 +36,34 @@ cd jrunner
|
|||||||
./gradlew build
|
./gradlew build
|
||||||
```
|
```
|
||||||
|
|
||||||
## deploy system-wide
|
## deploy
|
||||||
|
|
||||||
|
### using the deploy script (recommended)
|
||||||
```
|
```
|
||||||
sudo unzip app/build/distributions/app.zip -d /opt/
|
# Deploy to /opt/jrunner (default, creates system-wide symlink)
|
||||||
sudo ln -sf /opt/app/bin/app /usr/local/bin/jrunner
|
./deploy.sh
|
||||||
|
|
||||||
|
# Deploy to custom location (for testing, no symlink)
|
||||||
|
./deploy.sh /opt/jrunner-test
|
||||||
```
|
```
|
||||||
|
|
||||||
Now you can run from anywhere:
|
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:
|
||||||
```
|
```
|
||||||
jrunner -scu jdbc:postgresql://... -scn user -scp pass ...
|
jrunner -scu jdbc:postgresql://... -scn user -scp pass ...
|
||||||
```
|
```
|
||||||
|
|
||||||
To update after rebuilding:
|
After deployment to custom location:
|
||||||
```
|
```
|
||||||
./gradlew build
|
/opt/jrunner-test/bin/jrunner -scu jdbc:postgresql://... -scn user -scp pass ...
|
||||||
sudo rm -rf /opt/app
|
|
||||||
sudo unzip app/build/distributions/app.zip -d /opt/
|
|
||||||
```
|
```
|
||||||
|
|||||||
@ -8,4 +8,4 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rootProject.name = 'jrunner'
|
rootProject.name = 'jrunner'
|
||||||
include('app')
|
include('jrunner')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user