From ef249b17459ced97a6a7dcbe5571bc7c0b42410e Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Tue, 9 Jun 2026 08:32:57 -0400 Subject: [PATCH] Fix Bitbucket auth migration in deploy workflow --- README.md | 2 +- deploy.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4ecd78c..9a53b52 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Create the base directory and clone this environment: ```bash sudo mkdir -p /srv/env/aether sudo chown -R $USER:$USER /srv/env/aether -git clone https://bitbucket.org/oneskyit/one-sky-it-container-environment.git /srv/env/aether/container_env +git clone git@bitbucket.org:oneskyit/one-sky-it-container-environment.git /srv/env/aether/container_env ``` ### 3. Configure Environment Settings diff --git a/deploy.sh b/deploy.sh index a44baf9..e586aff 100755 --- a/deploy.sh +++ b/deploy.sh @@ -16,6 +16,18 @@ set -euo pipefail +ensure_bitbucket_ssh_remote() { + local repo_path=$1 + local remote_url + local remote_path + + remote_url=$(git -C "$repo_path" remote get-url origin) + if [[ "$remote_url" =~ ^https://([^@/]+@)?bitbucket\.org/(.+)$ ]]; then + remote_path=${BASH_REMATCH[2]} + git -C "$repo_path" remote set-url origin "git@bitbucket.org:${remote_path}" + fi +} + ENV=${1:-} if [ -z "$ENV" ]; then echo "Usage: $0 [app_branch] [api_branch]" @@ -55,14 +67,17 @@ echo "" # --- Pull repos --- echo "[1/4] Pulling container env..." +ensure_bitbucket_ssh_remote "$COMPOSE_DIR" git -C "$COMPOSE_DIR" pull --ff-only echo "" echo "[2/4] Pulling app ($APP_BRANCH)..." +ensure_bitbucket_ssh_remote "$APP_DIR" git -C "$APP_DIR" pull --ff-only origin "$APP_BRANCH" echo "" echo "[3/4] Pulling API ($API_BRANCH)..." +ensure_bitbucket_ssh_remote "$API_DIR" git -C "$API_DIR" pull --ff-only origin "$API_BRANCH" # --- Build and deploy ---