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>
This commit is contained in:
parent
c41ab99841
commit
0ecb6860bd
24
deploy.sh
24
deploy.sh
@ -1,15 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# Default deployment directory
|
||||||
|
DEPLOY_DIR="${1:-/opt/jrunner}"
|
||||||
|
|
||||||
echo "Building jrunner..."
|
echo "Building jrunner..."
|
||||||
./gradlew build
|
./gradlew build
|
||||||
|
|
||||||
echo "Deploying to /opt/jrunner..."
|
echo "Deploying to ${DEPLOY_DIR}..."
|
||||||
sudo rm -rf /opt/jrunner
|
sudo rm -rf "${DEPLOY_DIR}"
|
||||||
sudo unzip jrunner/build/distributions/jrunner.zip -d /opt/
|
sudo unzip jrunner/build/distributions/jrunner.zip -d "$(dirname "${DEPLOY_DIR}")"
|
||||||
|
|
||||||
echo "Creating symlink..."
|
# Only create symlink for default location
|
||||||
sudo ln -sf /opt/jrunner/bin/jrunner /usr/local/bin/jrunner
|
if [ "${DEPLOY_DIR}" = "/opt/jrunner" ]; then
|
||||||
|
echo "Creating symlink..."
|
||||||
echo "✅ Deployment complete!"
|
sudo ln -sf /opt/jrunner/bin/jrunner /usr/local/bin/jrunner
|
||||||
echo "Run 'jrunner --help' to test"
|
echo "✅ Deployment complete!"
|
||||||
|
echo "Run 'jrunner --help' to test"
|
||||||
|
else
|
||||||
|
echo "✅ Deployment complete!"
|
||||||
|
echo "Run '${DEPLOY_DIR}/bin/jrunner --help' to test"
|
||||||
|
fi
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user