- Déplace les migrations du service `migrate` séparé vers un entrypoint.sh - L'API exécute `sqlx migrate run` au démarrage avant de lancer le binaire - Gestion de la rétrocompatibilité : détecte un schéma pre-sqlx et crée une baseline `_sqlx_migrations` pour éviter les conflits sur les instances existantes - Installe sqlx-cli dans le builder, copie le binaire et les migrations dans l'image finale - Supprime le service `migrate` du docker-compose.yml ; l'indexer dépend maintenant du healthcheck de l'API (qui garantit que les migrations sont appliquées) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
41 lines
1.2 KiB
Bash
Executable File
41 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# Docker Hub
|
|
REGISTRY="docker.io"
|
|
OWNER="julienfroidefond32"
|
|
VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
|
|
|
|
SERVICES=("api" "indexer" "backoffice")
|
|
|
|
echo "=== Stripstream Librarian Docker Push ==="
|
|
echo "Registry: $REGISTRY"
|
|
echo "Version: $VERSION"
|
|
echo "Services: ${SERVICES[@]}"
|
|
echo ""
|
|
|
|
for service in "${SERVICES[@]}"; do
|
|
echo "Building $service..."
|
|
docker build -f apps/$service/Dockerfile -t $service:latest .
|
|
|
|
echo "Tagging $service..."
|
|
docker tag $service:latest $REGISTRY/$OWNER/stripstream-$service:$VERSION
|
|
docker tag $service:latest $REGISTRY/$OWNER/stripstream-$service:latest
|
|
|
|
echo "Pushing stripstream-$service:$VERSION..."
|
|
docker push $REGISTRY/$OWNER/stripstream-$service:$VERSION
|
|
|
|
echo "Pushing stripstream-$service:latest..."
|
|
docker push $REGISTRY/$OWNER/stripstream-$service:latest
|
|
|
|
echo "✓ $service pushed successfully"
|
|
echo ""
|
|
done
|
|
|
|
echo "=== All images pushed to $REGISTRY ==="
|
|
echo "Images:"
|
|
for service in "${SERVICES[@]}"; do
|
|
echo " - $REGISTRY/$OWNER/stripstream-$service:$VERSION"
|
|
echo " - $REGISTRY/$OWNER/stripstream-$service:latest"
|
|
done
|