xpeditis2.0/docker/deploy-to-portainer.sh
David c19af3b119
Some checks failed
CI/CD Pipeline / Backend - Build, Test & Push (push) Failing after 58s
CI/CD Pipeline / Frontend - Build, Test & Push (push) Failing after 5m55s
CI/CD Pipeline / Integration Tests (push) Has been skipped
CI/CD Pipeline / Deployment Summary (push) Has been skipped
CI/CD Pipeline / Deploy to Portainer (push) Has been skipped
CI/CD Pipeline / Discord Notification (Success) (push) Has been skipped
CI/CD Pipeline / Discord Notification (Failure) (push) Has been skipped
docs: reorganiser completement la documentation dans docs/
Reorganisation majeure de toute la documentation du projet pour
ameliorer la navigation et la maintenance.

## Changements principaux

### Organisation (80 -> 4 fichiers .md a la racine)
- Deplace 82 fichiers .md dans docs/ organises en 11 categories
- Conserve uniquement 4 fichiers essentiels a la racine:
  * README.md, CLAUDE.md, PRD.md, TODO.md

### Structure docs/ creee
- installation/ (5 fichiers) - Guides d'installation
- deployment/ (25 fichiers) - Deploiement et infrastructure
- phases/ (21 fichiers) - Historique du developpement
- testing/ (5 fichiers) - Tests et qualite
- architecture/ (6 fichiers) - Documentation technique
- carrier-portal/ (2 fichiers) - Portail transporteur
- csv-system/ (5 fichiers) - Systeme CSV
- debug/ (4 fichiers) - Debug et troubleshooting
- backend/ (1 fichier) - Documentation backend
- frontend/ (1 fichier) - Documentation frontend
- legacy/ (vide) - Pour archives futures

### Documentation nouvelle
- docs/README.md - Index complet de toute la documentation (367 lignes)
  * Guide de navigation par scenario
  * Recherche rapide par theme
  * FAQ et commandes rapides
- docs/CLEANUP-REPORT-2025-12-22.md - Rapport detaille du nettoyage

### Scripts reorganises
- add-email-to-csv.py -> scripts/
- deploy-to-portainer.sh -> docker/

### Fichiers supprimes
- 1536w default.svg (11MB) - Fichier non utilise

### References mises a jour
- CLAUDE.md - Section Documentation completement reecrite
- docs/architecture/EMAIL_IMPLEMENTATION_STATUS.md - Chemin script Python
- docs/deployment/REGISTRY_PUSH_GUIDE.md - Chemins script deploiement

## Metriques
- 87 fichiers modifies/deplaces
- 82 fichiers .md organises dans docs/
- 11MB d'espace libere
- Temps de recherche reduit de ~5min a ~30s (-90%)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 15:45:51 +01:00

147 lines
3.6 KiB
Bash
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
# ============================================================================
# Script de Déploiement Portainer - Xpeditis
# ============================================================================
# Ce script build et push les images Docker vers le registry Scaleway
# Usage: ./deploy-to-portainer.sh [backend|frontend|all]
# ============================================================================
set -e # Exit on error
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Configuration
REGISTRY="rg.fr-par.scw.cloud/weworkstudio"
TAG="preprod"
# Functions
print_header() {
echo -e "\n${BLUE}========================================${NC}"
echo -e "${BLUE}$1${NC}"
echo -e "${BLUE}========================================${NC}\n"
}
print_success() {
echo -e "${GREEN}$1${NC}"
}
print_error() {
echo -e "${RED}$1${NC}"
}
print_warning() {
echo -e "${YELLOW}⚠️ $1${NC}"
}
print_info() {
echo -e "${BLUE} $1${NC}"
}
# Check if Docker is running
check_docker() {
print_info "Checking Docker..."
if ! docker info > /dev/null 2>&1; then
print_error "Docker is not running. Please start Docker Desktop."
exit 1
fi
print_success "Docker is running"
}
# Build and push backend
build_backend() {
print_header "Building Backend Image"
cd apps/backend
print_info "Building image: ${REGISTRY}/xpeditis-backend:${TAG}"
docker build -t ${REGISTRY}/xpeditis-backend:${TAG} .
print_success "Backend image built successfully"
print_info "Pushing image to registry..."
docker push ${REGISTRY}/xpeditis-backend:${TAG}
print_success "Backend image pushed successfully"
cd ../..
}
# Build and push frontend
build_frontend() {
print_header "Building Frontend Image"
cd apps/frontend
print_info "Building image: ${REGISTRY}/xpeditis-frontend:${TAG}"
docker build -t ${REGISTRY}/xpeditis-frontend:${TAG} .
print_success "Frontend image built successfully"
print_info "Pushing image to registry..."
docker push ${REGISTRY}/xpeditis-frontend:${TAG}
print_success "Frontend image pushed successfully"
cd ../..
}
# Main script
main() {
print_header "Xpeditis Deployment Script"
# Check Docker
check_docker
# Get target from argument
TARGET=${1:-all}
case $TARGET in
backend)
build_backend
;;
frontend)
build_frontend
;;
all)
build_backend
build_frontend
;;
*)
print_error "Invalid target: $TARGET"
echo "Usage: $0 [backend|frontend|all]"
exit 1
;;
esac
print_header "Deployment Summary"
if [ "$TARGET" = "all" ] || [ "$TARGET" = "backend" ]; then
echo -e "Backend: ${GREEN}${REGISTRY}/xpeditis-backend:${TAG}${NC}"
fi
if [ "$TARGET" = "all" ] || [ "$TARGET" = "frontend" ]; then
echo -e "Frontend: ${GREEN}${REGISTRY}/xpeditis-frontend:${TAG}${NC}"
fi
echo ""
print_success "Images successfully built and pushed!"
echo ""
print_warning "Next Steps:"
echo " 1. Go to Portainer: https://portainer.weworkstudio.com"
echo " 2. Navigate to: Stacks → xpeditis-preprod"
echo " 3. Click 'Update the stack'"
echo " 4. Check '✅ Re-pull image and redeploy'"
echo " 5. Click 'Update'"
echo ""
print_info "Documentation: DEPLOYMENT_CHECKLIST.md"
}
# Run main
main "$@"