Files

56 lines
2.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# ==============================================================================
# Uruk International Prize - Deploy & Git Sync Pipeline
# Architect: Hamza Ayed (Founding Tech Architect)
# Remote: https://git.intaleqapp.com/Hamza/urukprize.git
# Server: root@vmi2613292:/home/urukprize/htdocs/urukprize.intaleqapp.com
# ==============================================================================
set -e
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m'
echo -e "${BLUE}======================================================${NC}"
echo -e "${BLUE} 🚀 Uruk Prize Platform - Deploy & Sync Pipeline ${NC}"
echo -e "${BLUE}======================================================${NC}"
# Check if git is initialized
if [ ! -d ".git" ]; then
echo -e "${YELLOW}⚡ Initializing local Git repository...${NC}"
git init
git checkout -b main || git checkout -b main
fi
# Ensure remote origin is set
REMOTE_URL="https://git.intaleqapp.com/Hamza/urukprize.git"
if ! git remote | grep -q 'origin'; then
echo -e "${YELLOW}🔗 Adding remote origin: ${REMOTE_URL}${NC}"
git remote add origin "$REMOTE_URL"
else
# Update origin URL if needed
git remote set-url origin "$REMOTE_URL"
fi
# 1. Staging files
echo -e "${BLUE}[1/3] Staging files...${NC}"
git add .
# 2. Committing with message or auto-timestamp
COMMIT_MSG=${1:-"Update Uruk Prize Core, Gateway & Documentation - $(date '+%Y-%m-%d %H:%M:%S')"}
echo -e "${BLUE}[2/3] Committing: ${YELLOW}'$COMMIT_MSG'${NC}"
git commit -m "$COMMIT_MSG" || echo -e "${YELLOW}No new changes to commit.${NC}"
# 3. Pushing to Git remote
echo -e "${BLUE}[3/3] Pushing to Git remote (${REMOTE_URL})...${NC}"
git push -u origin main
echo -e "${GREEN}======================================================${NC}"
echo -e "${GREEN}✓ Successfully pushed to Git repository!${NC}"
echo -e "${BLUE}Now, run on your server (CloudPanel terminal):${NC}"
echo -e "${YELLOW}cd /home/urukprize/htdocs/urukprize.intaleqapp.com && git pull origin main${NC}"
echo -e "${GREEN}======================================================${NC}"