Ajout des options --apache et --frankenphp pour le script de construction de l'image.
This commit is contained in:
@@ -18,12 +18,15 @@ Le script `./scripts/build-docker-image.sh` génère automatiquement la commande
|
||||
Exemple :
|
||||
|
||||
```bash
|
||||
./scripts/build-docker-image.sh --debug --build
|
||||
./scripts/build-docker-image.sh --debug --build --apache
|
||||
./scripts/build-docker-image.sh --debug --build --frankenphp
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
| Option | Description |
|
||||
| --------- | ------------------------------------------------------ |
|
||||
| -------------- | ------------------------------------------------------ |
|
||||
| `--debug` | Affiche la commande de construction de l'image. |
|
||||
| `--build` | Exécute la construction de l'image Docker. |
|
||||
| `--apache` | Utilise une image Apache. |
|
||||
| `--frankenphp` | Utilise une image FrankenPHP. |
|
||||
@@ -13,6 +13,9 @@ serverVersion=""
|
||||
serverName=""
|
||||
withDebug=false
|
||||
withBuild=false
|
||||
withApacheOption=false
|
||||
withFrankenphpOption=false
|
||||
|
||||
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
@@ -22,9 +25,32 @@ for arg in "$@"; do
|
||||
--build)
|
||||
withBuild=true
|
||||
;;
|
||||
--apache)
|
||||
withApacheOption=true
|
||||
;;
|
||||
--frankenphp)
|
||||
withFrankenphpOption=true
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Traitement des options --apache et --frankenphp
|
||||
if [[ "$withApacheOption" == "true" ]]; then
|
||||
if [[ "$APACHE_PHP_IMAGE" == "" ]]; then
|
||||
echo "La variable d'environnement APACHE_PHP_IMAGE n'est pas définie."
|
||||
exit 1
|
||||
else
|
||||
SERVER_PHP_IMAGE=$APACHE_PHP_IMAGE
|
||||
fi
|
||||
elif [[ "$withFrankenphpOption" == "true" ]]; then
|
||||
if [[ "$FRANKENPHP_IMAGE" == "" ]]; then
|
||||
echo "La variable d'environnement FRANKENPHP_IMAGE n'est pas définie."
|
||||
exit 1
|
||||
else
|
||||
SERVER_PHP_IMAGE=$FRANKENPHP_IMAGE
|
||||
fi
|
||||
fi
|
||||
|
||||
# Vérifie que le repository de l'image est définie
|
||||
if [[ "$SERVER_IMAGE_REPOSITORY" == "" ]]; then
|
||||
echo "Le repository de l'image est inconnu. Veuillez définir la variable d'environnement SERVER_IMAGE_REPOSITORY."
|
||||
|
||||
Reference in New Issue
Block a user