Compare commits
8 Commits
b0f104927c
...
57093441c3
| Author | SHA1 | Date | |
|---|---|---|---|
| 57093441c3 | |||
| f084f8380a | |||
| a9bd96b377 | |||
| c6d34847d5 | |||
| 4b8ffcdd1c | |||
| e9fc745d20 | |||
| 9cf698c67d | |||
| 20d40f069d |
4
.gitignore
vendored
4
.gitignore
vendored
@ -8,3 +8,7 @@ build
|
|||||||
|
|
||||||
# Ignore local configuration files
|
# Ignore local configuration files
|
||||||
run.yml
|
run.yml
|
||||||
|
|
||||||
|
# Ignore accidentally extracted distribution files in project root
|
||||||
|
/bin/
|
||||||
|
/lib/
|
||||||
|
|||||||
39
deploy.sh
39
deploy.sh
@ -1,23 +1,42 @@
|
|||||||
#!/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 "Deploying to ${DEPLOY_DIR}..."
|
echo "Extracting to temporary location..."
|
||||||
sudo rm -rf "${DEPLOY_DIR}"
|
sudo rm -rf /tmp/jrunner
|
||||||
sudo unzip jrunner/build/distributions/jrunner.zip -d "$(dirname "${DEPLOY_DIR}")"
|
sudo unzip -q jrunner/build/distributions/jrunner.zip -d /tmp/
|
||||||
|
|
||||||
# Only create symlink for default location
|
echo "Deploying to ${DEPLOY_DIR}..."
|
||||||
|
sudo rm -rf "${DEPLOY_DIR}"/*
|
||||||
|
sudo mv /tmp/jrunner/* "${DEPLOY_DIR}"/
|
||||||
|
sudo rm -rf /tmp/jrunner
|
||||||
|
|
||||||
|
echo "Fixing ownership..."
|
||||||
|
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
|
||||||
echo "✅ Deployment complete!"
|
|
||||||
echo "Run 'jrunner --help' to test"
|
|
||||||
else
|
|
||||||
echo "✅ Deployment complete!"
|
|
||||||
echo "Run '${DEPLOY_DIR}/bin/jrunner --help' to test"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "✅ Deployed to ${DEPLOY_DIR}"
|
||||||
|
echo "Run '${DEPLOY_DIR}/bin/jrunner --help' to test"
|
||||||
|
|||||||
@ -39,7 +39,7 @@ public class jrunner {
|
|||||||
Timestamp tsStart = null;
|
Timestamp tsStart = null;
|
||||||
Timestamp tsEnd = null;
|
Timestamp tsEnd = null;
|
||||||
|
|
||||||
msg = "jrunner version 0.41";
|
msg = "jrunner version 1.0";
|
||||||
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,15 +39,23 @@ 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 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.
|
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`.
|
||||||
|
|
||||||
### manual deployment
|
### manual deployment
|
||||||
```
|
```
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user