From 0ecb6860bd0d67df2beefc93225c127431a7efe7 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Tue, 6 Jan 2026 22:00:31 -0500 Subject: [PATCH] make deploy location configurable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- deploy.sh | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/deploy.sh b/deploy.sh index fb7a4a7..a45813d 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,15 +1,23 @@ #!/bin/bash set -e +# Default deployment directory +DEPLOY_DIR="${1:-/opt/jrunner}" + echo "Building jrunner..." ./gradlew build -echo "Deploying to /opt/jrunner..." -sudo rm -rf /opt/jrunner -sudo unzip jrunner/build/distributions/jrunner.zip -d /opt/ +echo "Deploying to ${DEPLOY_DIR}..." +sudo rm -rf "${DEPLOY_DIR}" +sudo unzip jrunner/build/distributions/jrunner.zip -d "$(dirname "${DEPLOY_DIR}")" -echo "Creating symlink..." -sudo ln -sf /opt/jrunner/bin/jrunner /usr/local/bin/jrunner - -echo "✅ Deployment complete!" -echo "Run 'jrunner --help' to test" +# 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