Files
cmss-projet/infrastructure/setup-minio/init-minio.sh
2025-11-03 21:53:58 +01:00

27 lines
774 B
Bash
Executable File
Raw 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/sh
set -e
# Attendre que MinIO démarre
echo "⏳ Attente du démarrage de MinIO..."
sleep 5
# Configuration du client MinIO (mc)
echo "🔧 Configuration du client MinIO..."
mc alias set myminio http://minio:9000 "$MINIO_ROOT_USER" "$MINIO_ROOT_PASSWORD"
# Création du bucket sil nexiste pas déjà
echo "🪣 Vérification du bucket 'bucketforum'..."
if ! mc ls myminio | grep -q "bucketforum"; then
mc mb myminio/bucketforum
echo "✅ Bucket 'bucketforum' créé."
else
echo " Bucket 'bucketforum' déjà existant."
fi
# Rendre le bucket public
echo "🌍 Configuration de la politique publique..."
mc anonymous set public myminio/bucketforum
# Vérification du statut
echo "✅ Bucket 'bucketforum' est public et prêt à être utilisé."