refactor: migrar GitLab → Gitea (aulas 10, 11, 13)

- Aula 10: Gitea + Registry + Actions + Runner (substituiu GitLab)
  - gitea-values.yaml: PostgreSQL standalone, Valkey standalone, ~800Mi RAM
  - setup.sh/cleanup.sh: namespace gitea, Helm gitea-charts/gitea + actions
  - README.md: documentação completa com de→para (GitLab/Harbor/Tekton vs Gitea)

- Aula 11: ArgoCD (GitOps) — removido GitLab Runner (runner vive na aula-10)
  - setup.sh: só ArgoCD, integração SSH com Gitea
  - node-bugado/.gitea/workflows/ci.yml: pipeline convertida

- Aula 13: Container Factory — atualizado para Gitea
  - setup.sh/cleanup.sh: referências GitLab → Gitea
  - pipelines/postgresql/ci.yml: Gitea Actions workflow
  - README.md: conexão com act_runner explicada

- CLAUDE.md: tabela de aulas atualizada
This commit is contained in:
ArgoCD Setup
2026-03-14 01:44:30 -03:00
parent ff7af56c30
commit d380cd8585
35 changed files with 3374 additions and 1202 deletions

71
aula-13/cleanup.sh Executable file
View File

@@ -0,0 +1,71 @@
#!/bin/bash
# =============================================================================
# Aula 13 - Cleanup
# =============================================================================
set -e
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
log_success() { echo -e "${GREEN}[OK]${NC} $1"; }
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Carregar configuração
if [[ -f "${SCRIPT_DIR}/.env" ]]; then
source "${SCRIPT_DIR}/.env"
fi
DEPLOY_NAMESPACE="${DEPLOY_NAMESPACE:-factory}"
echo ""
echo "=========================================="
echo " Removendo Container Factory"
echo "=========================================="
echo ""
# Remover recursos do PostgreSQL
log_info "Removendo PostgreSQL..."
kubectl delete -f "${SCRIPT_DIR}/k8s/postgresql/deployment.yaml" -n ${DEPLOY_NAMESPACE} 2>/dev/null || true
kubectl delete -f "${SCRIPT_DIR}/k8s/postgresql/service.yaml" -n ${DEPLOY_NAMESPACE} 2>/dev/null || true
kubectl delete -f "${SCRIPT_DIR}/k8s/postgresql/configmap.yaml" -n ${DEPLOY_NAMESPACE} 2>/dev/null || true
kubectl delete secret postgresql-secret -n ${DEPLOY_NAMESPACE} 2>/dev/null || true
# Perguntar sobre PVC (dados serão perdidos!)
echo ""
log_warn "O PVC contém os dados do PostgreSQL!"
read -p "Remover PVC (DADOS SERÃO PERDIDOS)? [y/N]: " REMOVE_PVC
if [[ "$REMOVE_PVC" =~ ^[Yy]$ ]]; then
kubectl delete -f "${SCRIPT_DIR}/k8s/postgresql/pvc.yaml" -n ${DEPLOY_NAMESPACE} 2>/dev/null || true
log_success "PVC removido"
else
log_info "PVC mantido"
fi
# Remover namespace (opcional)
echo ""
read -p "Remover namespace ${DEPLOY_NAMESPACE}? [y/N]: " REMOVE_NS
if [[ "$REMOVE_NS" =~ ^[Yy]$ ]]; then
kubectl delete namespace ${DEPLOY_NAMESPACE} --timeout=60s 2>/dev/null || true
log_success "Namespace removido"
fi
# Remover .env
if [[ -f "${SCRIPT_DIR}/.env" ]]; then
rm "${SCRIPT_DIR}/.env"
log_info ".env removido"
fi
echo ""
log_success "Cleanup concluído!"
echo ""
echo "Nota: As imagens no registry não foram removidas."
echo "Para remover, acesse o Gitea Packages manualmente:"
echo " https://${GITEA_HOST:-gitea.kube.quest}/factory/postgresql/packages"
echo ""