Compare commits
No commits in common. "57093441c33b6560589c887ccc28a34b79fc8acb" and "b0f104927cccefb91afe2ffc33f7cff27e6d1954" have entirely different histories.
57093441c3
...
b0f104927c
4
.gitignore
vendored
4
.gitignore
vendored
@ -8,7 +8,3 @@ build
|
|||||||
|
|
||||||
# Ignore local configuration files
|
# Ignore local configuration files
|
||||||
run.yml
|
run.yml
|
||||||
|
|
||||||
# Ignore accidentally extracted distribution files in project root
|
|
||||||
/bin/
|
|
||||||
/lib/
|
|
||||||
|
|||||||
37
deploy.sh
37
deploy.sh
@ -1,42 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# Default deployment directory
|
||||||
DEPLOY_DIR="${1:-/opt/jrunner}"
|
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..."
|
echo "Building jrunner..."
|
||||||
./gradlew build
|
./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}..."
|
echo "Deploying to ${DEPLOY_DIR}..."
|
||||||
sudo rm -rf "${DEPLOY_DIR}"/*
|
sudo rm -rf "${DEPLOY_DIR}"
|
||||||
sudo mv /tmp/jrunner/* "${DEPLOY_DIR}"/
|
sudo unzip jrunner/build/distributions/jrunner.zip -d "$(dirname "${DEPLOY_DIR}")"
|
||||||
sudo rm -rf /tmp/jrunner
|
|
||||||
|
|
||||||
echo "Fixing ownership..."
|
# Only create symlink for default location
|
||||||
sudo chown -R $USER:$USER "${DEPLOY_DIR}"
|
|
||||||
|
|
||||||
# Only create symlink for /opt/jrunner
|
|
||||||
if [ "${DEPLOY_DIR}" = "/opt/jrunner" ]; then
|
if [ "${DEPLOY_DIR}" = "/opt/jrunner" ]; then
|
||||||
echo "Creating symlink..."
|
echo "Creating symlink..."
|
||||||
sudo ln -sf /opt/jrunner/bin/jrunner /usr/local/bin/jrunner
|
sudo ln -sf /opt/jrunner/bin/jrunner /usr/local/bin/jrunner
|
||||||
fi
|
echo "✅ Deployment complete!"
|
||||||
|
echo "Run 'jrunner --help' to test"
|
||||||
echo "✅ Deployed to ${DEPLOY_DIR}"
|
else
|
||||||
|
echo "✅ Deployment complete!"
|
||||||
echo "Run '${DEPLOY_DIR}/bin/jrunner --help' to test"
|
echo "Run '${DEPLOY_DIR}/bin/jrunner --help' to test"
|
||||||
|
fi
|
||||||
|
|||||||
@ -39,7 +39,7 @@ public class jrunner {
|
|||||||
Timestamp tsStart = null;
|
Timestamp tsStart = null;
|
||||||
Timestamp tsEnd = null;
|
Timestamp tsEnd = null;
|
||||||
|
|
||||||
msg = "jrunner version 1.0";
|
msg = "jrunner version 0.41";
|
||||||
msg = msg + nl + "-scu source jdbc url";
|
msg = msg + nl + "-scu source jdbc url";
|
||||||
msg = msg + nl + "-scn source username";
|
msg = msg + nl + "-scn source username";
|
||||||
msg = msg + nl + "-scp source passowrd";
|
msg = msg + nl + "-scp source passowrd";
|
||||||
|
|||||||
10
readme.md
10
readme.md
@ -39,23 +39,15 @@ cd jrunner
|
|||||||
## deploy
|
## deploy
|
||||||
|
|
||||||
### using the deploy script (recommended)
|
### 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 to /opt/jrunner (default, creates system-wide symlink)
|
||||||
./deploy.sh
|
./deploy.sh
|
||||||
|
|
||||||
# Deploy to custom location (for testing, no symlink)
|
# Deploy to custom location (for testing, no symlink)
|
||||||
sudo mkdir -p /opt/jrunner-test
|
|
||||||
./deploy.sh /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
|
### manual deployment
|
||||||
```
|
```
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user