Clean up entrypoint startup logs and remove GitHub auth handling
This commit is contained in:
@@ -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..."
|
||||
|
||||
Reference in New Issue
Block a user