Compare commits

...

4 Commits

Author SHA1 Message Date
b0f104927c document deploy script usage in readme
Add clear documentation showing:
- deploy.sh with no arguments uses default /opt/jrunner location
- deploy.sh with argument deploys to custom location for testing
- Explain symlink behavior (only for default location)
- Show usage examples for both deployment types

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-06 22:03:14 -05:00
0ecb6860bd make deploy location configurable
Allow specifying custom deployment directory as argument, defaulting to
/opt/jrunner if not provided. Symlink to /usr/local/bin only created
for default location to avoid overwriting production.

Usage:
  ./deploy.sh                    # deploys to /opt/jrunner (default)
  ./deploy.sh /opt/jrunner-test  # test deployment

This allows testing new builds without affecting production deployment.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-06 22:00:31 -05:00
c41ab99841 update and rename deployment script
Renamed copy_to_apt.sh to deploy.sh (clearer name) and updated to:
- Use new jrunner/ paths instead of app/
- Add build step so script handles full build+deploy
- Create symlink to /usr/local/bin for system-wide access
- Remove unused JR environment variable export
- Add set -e for error handling
- Add progress messages

Usage: ./deploy.sh

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-06 21:57:54 -05:00
8cdd88d053 rename app module to jrunner for consistency
Changes:
- Rename app/ directory to jrunner/ (preserves git history)
- Update settings.gradle to reference jrunner module
- Update readme.md with new paths (jrunner/build/, /opt/jrunner)
- Update CLAUDE.md documentation with new file paths

Build outputs now named jrunner.zip, jrunner.jar, bin/jrunner instead
of generic "app" names. This makes the project structure clearer and
aligns module name with project name.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-06 21:53:08 -05:00
8 changed files with 51 additions and 23 deletions

View File

@ -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

View File

@ -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
View 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

View File

@ -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/
``` ```

View File

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