diff --git a/scripts/diagnostic-logger.sh b/scripts/diagnostic-logger.sh index dd58fa0..a3f849d 100644 --- a/scripts/diagnostic-logger.sh +++ b/scripts/diagnostic-logger.sh @@ -166,8 +166,6 @@ validate_environment() { "DODO_PAYMENTS_API_KEY" "ADMIN_USER" "ADMIN_PASSWORD" - "REPO_URL" - "REPO_BRANCH" ) # Check critical variables diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 9897e3b..2308d8a 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -76,20 +76,6 @@ log "=== ENVIRONMENT SANITIZATION COMPLETE ===" REPO_URL="${REPO_URL:-}" REPO_DIR="/home/web/data" REPO_BRANCH="${REPO_BRANCH:-main}" -GITHUB_USERNAME="${GITHUB_USERNAME:-}" -GITHUB_PAT="${GITHUB_PAT:-}" - -# Helper function to get authenticated repository URL -get_auth_url() { - local url="$1" - if [ -n "$GITHUB_USERNAME" ] && [ -n "$GITHUB_PAT" ]; then - # Extract the repository path from the URL - local repo_path=$(echo "$url" | sed 's|https://github.com/||') - echo "https://${GITHUB_USERNAME}:${GITHUB_PAT}@github.com/${repo_path}" - else - echo "$url" - fi -} log "Initializing Shopify AI App Builder..." @@ -123,22 +109,14 @@ if [ -n "$REPO_URL" ]; then fi log "Repository not found. Cloning $REPO_URL into $REPO_DIR..." - auth_url=$(get_auth_url "$REPO_URL") - git clone "$auth_url" "$REPO_DIR" + git clone "$REPO_URL" "$REPO_DIR" cd "$REPO_DIR" log "Successfully cloned repository" else # Repository exists, pull latest changes cd "$REPO_DIR" log "Repository found at $REPO_DIR. Pulling latest changes from $REPO_BRANCH..." - - # Update remote URL to use authentication if credentials are available - if [ -n "$GITHUB_USERNAME" ] && [ -n "$GITHUB_PAT" ]; then - auth_url=$(get_auth_url "$REPO_URL") - log "Updating remote URL with authentication credentials" - git remote set-url origin "$auth_url" - fi - + # Check if we're on a detached HEAD or have uncommitted changes if git diff --quiet && git diff --cached --quiet; then git fetch origin @@ -155,8 +133,8 @@ if [ -n "$REPO_URL" ]; then fi log "Repository is ready at $REPO_DIR" else - log "No REPO_URL set - starting with empty workspace" mkdir -p "$REPO_DIR" + log "Workspace directory ready at $REPO_DIR" fi log "Starting Shopify AI App Builder service..."