Ajout de l'option --push-image dans le script du build pour pouvoir publier l'image.
This commit is contained in:
@@ -28,5 +28,6 @@ Exemple :
|
|||||||
| -------------- | ------------------------------------------------------ |
|
| -------------- | ------------------------------------------------------ |
|
||||||
| `--debug` | Affiche la commande de construction de l'image. |
|
| `--debug` | Affiche la commande de construction de l'image. |
|
||||||
| `--build` | Exécute la construction de l'image Docker. |
|
| `--build` | Exécute la construction de l'image Docker. |
|
||||||
|
| `--push-image` | Push de l'image dans le Registry Docker. |
|
||||||
| `--apache` | Utilise une image Apache. |
|
| `--apache` | Utilise une image Apache. |
|
||||||
| `--frankenphp` | Utilise une image FrankenPHP. |
|
| `--frankenphp` | Utilise une image FrankenPHP. |
|
||||||
@@ -13,10 +13,10 @@ serverVersion=""
|
|||||||
serverName=""
|
serverName=""
|
||||||
withDebug=false
|
withDebug=false
|
||||||
withBuild=false
|
withBuild=false
|
||||||
|
withPushImage=false
|
||||||
withApacheOption=false
|
withApacheOption=false
|
||||||
withFrankenphpOption=false
|
withFrankenphpOption=false
|
||||||
|
|
||||||
|
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
--debug)
|
--debug)
|
||||||
@@ -25,6 +25,9 @@ for arg in "$@"; do
|
|||||||
--build)
|
--build)
|
||||||
withBuild=true
|
withBuild=true
|
||||||
;;
|
;;
|
||||||
|
--push-image)
|
||||||
|
withPushImage=true
|
||||||
|
;;
|
||||||
--apache)
|
--apache)
|
||||||
withApacheOption=true
|
withApacheOption=true
|
||||||
;;
|
;;
|
||||||
@@ -119,3 +122,8 @@ if [[ "$withBuild" == "true" ]]; then
|
|||||||
eval "$buildCommand"
|
eval "$buildCommand"
|
||||||
echo "Build de l'image ${phpVersion}-${serverName,,}-${serverVersion} terminé."
|
echo "Build de l'image ${phpVersion}-${serverName,,}-${serverVersion} terminé."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$withPushImage" == "true" ]]; then
|
||||||
|
docker push $dockerImageTag
|
||||||
|
echo "Push du tag $dockerImageTag."
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user