Files

34 lines
1.2 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# ---------------------------------------------------------
# STEELXR: SCRIPT DE ATUALIZAÇÃO E DEPLOY AUTOMÁTICO
# ---------------------------------------------------------
CYAN='\033[0;36m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m'
echo -e "\n${CYAN}🚀 Iniciando Ciclo Automático SteelXR...${NC}"
# 1. Sincronização com Repositório Git (se existir)
if [ -d .git ]; then
echo -e "${YELLOW}📝 Sincronizando código com Git...${NC}"
git add .
if git diff-index --quiet HEAD --; then
echo -e "${GREEN}✨ Código local já está sincronizado.${NC}"
else
TIMESTAMP=$(date +"%d/%m/%Y %H:%M:%S")
echo -e "${CYAN}📤 Gravando alterações (Auto-update $TIMESTAMP)...${NC}"
git commit -m "🚀 Auto-deploy: melhoria no snap e medição AR em $TIMESTAMP"
if git remote | grep -q 'origin'; then
echo -e "${CYAN}📤 Enviando para o repositório remoto (Gitea)...${NC}"
git push origin main
fi
fi
else
echo -e "${YELLOW}️ Diretório não é um repositório Git. Pulando sincronização Git.${NC}"
fi
echo -e "${GREEN}🏁 Ciclo concluído com sucesso. O webhook do Coolify iniciará o deploy na VPS.${NC}\n"