mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-28 23:43:22 +00:00
feat: Mise à jour des Dockerfile préparation d'un environnement de démo [#12]
This commit is contained in:
53
ci-script/makeDocker.sh
Normal file
53
ci-script/makeDocker.sh
Normal file
@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Récupération de la version depuis les arguments
|
||||
VERSION=$1
|
||||
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Erreur: Version non spécifiée"
|
||||
echo "Usage: ./makeDocker.sh <version>"
|
||||
exit 1
|
||||
fi
|
||||
SCRIPT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
cd $SCRIPT_PATH
|
||||
# Configuration
|
||||
DOCKER_REGISTRY="git.v0id.ovh"
|
||||
APP_NAME="n3wt-school"
|
||||
|
||||
echo "Début de la construction des images Docker pour la version ${VERSION}"
|
||||
|
||||
# Construction de l'image Frontend
|
||||
echo "Construction de l'image Frontend..."
|
||||
cd ../Front-End
|
||||
docker build \
|
||||
--build-arg BUILD_MODE=production \
|
||||
-t ${DOCKER_REGISTRY}/n3wt-innov/${APP_NAME}/frontend:${VERSION} \
|
||||
-t ${DOCKER_REGISTRY}/n3wt-innov/${APP_NAME}/frontend:latest \
|
||||
.
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Échec de la construction de l'image Frontend"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Construction de l'image Backend
|
||||
echo "Construction de l'image Backend..."
|
||||
cd ../Back-End
|
||||
docker build \
|
||||
-t ${DOCKER_REGISTRY}/n3wt-innov/${APP_NAME}/backend:${VERSION} \
|
||||
-t ${DOCKER_REGISTRY}/n3wt-innov/${APP_NAME}/backend:latest \
|
||||
.
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Échec de la construction de l'image Backend"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Construction des images Docker terminée avec succès"
|
||||
echo "Images créées :"
|
||||
echo "- ${DOCKER_REGISTRY}/${APP_NAME}/frontend:${VERSION}"
|
||||
echo "- ${DOCKER_REGISTRY}/${APP_NAME}/frontend:latest"
|
||||
echo "- ${DOCKER_REGISTRY}/${APP_NAME}/backend:${VERSION}"
|
||||
echo "- ${DOCKER_REGISTRY}/${APP_NAME}/backend:latest"
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user