From 840715edc89c7037c2726d55b55bfb1690d2c131 Mon Sep 17 00:00:00 2001 From: Dylan Govender Date: Tue, 27 Jan 2026 15:10:59 +0200 Subject: [PATCH 1/3] Use pipe instead of forward slash as delimiter for GIT_REPOSITORY --- base/scripts/onyxia-init.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/base/scripts/onyxia-init.sh b/base/scripts/onyxia-init.sh index 3fa7f576..6c92a495 100755 --- a/base/scripts/onyxia-init.sh +++ b/base/scripts/onyxia-init.sh @@ -92,12 +92,12 @@ if command -v git &>/dev/null; then fi if [[ -n "$GIT_REPOSITORY" ]]; then if [[ -n "$GIT_PERSONAL_ACCESS_TOKEN" ]]; then - REPO_DOMAIN=`echo "$GIT_REPOSITORY" | awk -F/ '{print $3}'` - if [ $REPO_DOMAIN = "github.com" ]; then - GIT_REPOSITORY=`echo $GIT_REPOSITORY | sed "s/$REPO_DOMAIN/$GIT_PERSONAL_ACCESS_TOKEN@$REPO_DOMAIN/"` - else - GIT_REPOSITORY=`echo $GIT_REPOSITORY | sed "s/$REPO_DOMAIN/oauth2:$GIT_PERSONAL_ACCESS_TOKEN@$REPO_DOMAIN/"` - fi + REPO_DOMAIN=$(echo "$GIT_REPOSITORY" | awk -F/ '{print $3}') + if [ "$REPO_DOMAIN" = "github.com" ]; then + GIT_REPOSITORY=$(echo "$GIT_REPOSITORY" | sed "s|$REPO_DOMAIN|$GIT_PERSONAL_ACCESS_TOKEN@$REPO_DOMAIN|") + else + GIT_REPOSITORY=$(echo "$GIT_REPOSITORY" | sed "s|$REPO_DOMAIN|oauth2:$GIT_PERSONAL_ACCESS_TOKEN@$REPO_DOMAIN|") + fi fi if [[ -n "$GIT_BRANCH" ]]; then From 751df1b5bc190357dbb63358762813912f68b224 Mon Sep 17 00:00:00 2001 From: Dylan Govender Date: Thu, 29 Jan 2026 17:00:27 +0200 Subject: [PATCH 2/3] Cater for git repos from bitbucket instances --- base/scripts/onyxia-init.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/base/scripts/onyxia-init.sh b/base/scripts/onyxia-init.sh index 6c92a495..92f281e3 100755 --- a/base/scripts/onyxia-init.sh +++ b/base/scripts/onyxia-init.sh @@ -95,6 +95,8 @@ if command -v git &>/dev/null; then REPO_DOMAIN=$(echo "$GIT_REPOSITORY" | awk -F/ '{print $3}') if [ "$REPO_DOMAIN" = "github.com" ]; then GIT_REPOSITORY=$(echo "$GIT_REPOSITORY" | sed "s|$REPO_DOMAIN|$GIT_PERSONAL_ACCESS_TOKEN@$REPO_DOMAIN|") + elif echo "$GIT_REPOSITORY" | grep -qi "bitbucket"; then + GIT_REPOSITORY=$(echo "$GIT_REPOSITORY" | sed "s|$REPO_DOMAIN|$GIT_USER_NAME:$GIT_PERSONAL_ACCESS_TOKEN@$REPO_DOMAIN|") else GIT_REPOSITORY=$(echo "$GIT_REPOSITORY" | sed "s|$REPO_DOMAIN|oauth2:$GIT_PERSONAL_ACCESS_TOKEN@$REPO_DOMAIN|") fi From 65305348e891bf961e7d9b7b19a6ef8b2da2398f Mon Sep 17 00:00:00 2001 From: Dylan Govender Date: Thu, 29 Jan 2026 17:00:43 +0200 Subject: [PATCH 3/3] Neaten indentation --- base/scripts/onyxia-init.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/base/scripts/onyxia-init.sh b/base/scripts/onyxia-init.sh index 92f281e3..414c6333 100755 --- a/base/scripts/onyxia-init.sh +++ b/base/scripts/onyxia-init.sh @@ -92,14 +92,15 @@ if command -v git &>/dev/null; then fi if [[ -n "$GIT_REPOSITORY" ]]; then if [[ -n "$GIT_PERSONAL_ACCESS_TOKEN" ]]; then - REPO_DOMAIN=$(echo "$GIT_REPOSITORY" | awk -F/ '{print $3}') - if [ "$REPO_DOMAIN" = "github.com" ]; then + REPO_DOMAIN=$(echo "$GIT_REPOSITORY" | awk -F/ '{print $3}') + if [ "$REPO_DOMAIN" = "github.com" ]; then + GIT_REPOSITORY=$(echo "$GIT_REPOSITORY" | sed "s|$REPO_DOMAIN|$GIT_PERSONAL_ACCESS_TOKEN@$REPO_DOMAIN|") GIT_REPOSITORY=$(echo "$GIT_REPOSITORY" | sed "s|$REPO_DOMAIN|$GIT_PERSONAL_ACCESS_TOKEN@$REPO_DOMAIN|") - elif echo "$GIT_REPOSITORY" | grep -qi "bitbucket"; then - GIT_REPOSITORY=$(echo "$GIT_REPOSITORY" | sed "s|$REPO_DOMAIN|$GIT_USER_NAME:$GIT_PERSONAL_ACCESS_TOKEN@$REPO_DOMAIN|") - else - GIT_REPOSITORY=$(echo "$GIT_REPOSITORY" | sed "s|$REPO_DOMAIN|oauth2:$GIT_PERSONAL_ACCESS_TOKEN@$REPO_DOMAIN|") - fi + elif echo "$GIT_REPOSITORY" | grep -qi "bitbucket"; then + GIT_REPOSITORY=$(echo "$GIT_REPOSITORY" | sed "s|$REPO_DOMAIN|$GIT_USER_NAME:$GIT_PERSONAL_ACCESS_TOKEN@$REPO_DOMAIN|") + else + GIT_REPOSITORY=$(echo "$GIT_REPOSITORY" | sed "s|$REPO_DOMAIN|oauth2:$GIT_PERSONAL_ACCESS_TOKEN@$REPO_DOMAIN|") + fi fi if [[ -n "$GIT_BRANCH" ]]; then