forked from CraigGoesCoding/express-reverse-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
otro.sh
33 lines (22 loc) · 1.11 KB
/
otro.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
APP_NAME="app"
DOCKER_COMPOSE_FILE="docker-compose.yml"
echo "Obteniendo la ultima version de la imagen de Docker Hub..."
docker pull masterpablo/express_reverse_proxy:master
echo "¡La imagen se ha obtenido con exito!"
echo "Verificando si la version de la imagen es diferente a la que se esta ejecutando..."
if [ "$(docker images -q masterpablo/express_reverse_proxy:master)" != "$(docker images -q masterpablo/express_reverse_proxy:master)" ]; then
echo "La version de la imagen es diferente a la que se esta ejecutando."
echo "Deteniendo la aplicacion..."
docker-compose -f $DOCKER_COMPOSE_FILE down
echo "¡La aplicacion se ha detenido con exito!"
echo "Actualizando la imagen..."
docker-compose -f $DOCKER_COMPOSE_FILE pull masterpablo/express_reverse_proxy:master
echo "¡La imagen se ha actualizado con exito!"
echo "Volviendo a iniciar la aplicacion..."
docker-compose -f $DOCKER_COMPOSE_FILE up -d
echo "¡La aplicacion se ha iniciado con exito!"
else
echo "La version de la imagen es la misma que la que se esta ejecutando, no es necesario actualizarla."
fi
echo "¡El script ha finalizado con exito!"