Compare commits

..

No commits in common. "57093441c33b6560589c887ccc28a34b79fc8acb" and "b0f104927cccefb91afe2ffc33f7cff27e6d1954" have entirely different histories.

4 changed files with 11 additions and 42 deletions

4
.gitignore vendored
View File

@ -8,7 +8,3 @@ build
# Ignore local configuration files
run.yml
# Ignore accidentally extracted distribution files in project root
/bin/
/lib/

View File

@ -1,42 +1,23 @@
#!/bin/bash
set -e
# Default deployment directory
DEPLOY_DIR="${1:-/opt/jrunner}"
# Prevent deleting critical system directories
case "${DEPLOY_DIR}" in
/|/bin|/boot|/dev|/etc|/lib|/lib64|/proc|/root|/run|/sbin|/sys|/usr|/var)
echo "Error: Cannot deploy to system directory: ${DEPLOY_DIR}"
exit 1
;;
esac
if [ ! -d "${DEPLOY_DIR}" ]; then
echo "Error: Directory does not exist: ${DEPLOY_DIR}"
echo "Create it first: sudo mkdir -p ${DEPLOY_DIR}"
exit 1
fi
echo "Building jrunner..."
./gradlew build
echo "Extracting to temporary location..."
sudo rm -rf /tmp/jrunner
sudo unzip -q jrunner/build/distributions/jrunner.zip -d /tmp/
echo "Deploying to ${DEPLOY_DIR}..."
sudo rm -rf "${DEPLOY_DIR}"/*
sudo mv /tmp/jrunner/* "${DEPLOY_DIR}"/
sudo rm -rf /tmp/jrunner
sudo rm -rf "${DEPLOY_DIR}"
sudo unzip jrunner/build/distributions/jrunner.zip -d "$(dirname "${DEPLOY_DIR}")"
echo "Fixing ownership..."
sudo chown -R $USER:$USER "${DEPLOY_DIR}"
# Only create symlink for /opt/jrunner
# 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
echo "✅ Deployed to ${DEPLOY_DIR}"
echo "Run '${DEPLOY_DIR}/bin/jrunner --help' to test"

View File

@ -39,7 +39,7 @@ public class jrunner {
Timestamp tsStart = null;
Timestamp tsEnd = null;
msg = "jrunner version 1.0";
msg = "jrunner version 0.41";
msg = msg + nl + "-scu source jdbc url";
msg = msg + nl + "-scn source username";
msg = msg + nl + "-scp source passowrd";

View File

@ -39,23 +39,15 @@ cd jrunner
## deploy
### using the deploy script (recommended)
First, create the deployment directory:
```
sudo mkdir -p /opt/jrunner
```
Then deploy:
```
# Deploy to /opt/jrunner (default, creates system-wide symlink)
./deploy.sh
# Deploy to custom location (for testing, no symlink)
sudo mkdir -p /opt/jrunner-test
./deploy.sh /opt/jrunner-test
```
The script builds, extracts to a temporary location, and only updates the target directory after the build succeeds. This ensures your existing deployment stays intact if the build fails. When deploying to `/opt/jrunner`, it creates a symlink at `/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
```