34 lines
1.1 KiB
Bash
Executable File
34 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
# Instala o reinstala ISSSTELEON. Se puede correr las veces que sea:
|
|
# nunca borra datos (viven en ISSSTELEON_DATOS).
|
|
. "$(dirname "$0")/comun.sh"
|
|
requisitos
|
|
|
|
if [ ! -f .env ]; then
|
|
cp .env.ejemplo .env
|
|
chmod 600 .env
|
|
echo "Se creó .env a partir de .env.ejemplo."
|
|
echo "Edítelo (al menos ISSSTELEON_DATOS) y vuelva a correr ./instalar.sh"
|
|
exit 1
|
|
fi
|
|
leer_env
|
|
|
|
for imagen in webapi webapp; do
|
|
if docker image inspect "isssteleon/$imagen:$ISSSTELEON_VERSION" >/dev/null 2>&1; then
|
|
aviso "Imagen isssteleon/$imagen:$ISSSTELEON_VERSION ya cargada"
|
|
else
|
|
archivo="imagenes/isssteleon-$imagen-$ISSSTELEON_VERSION.tar.gz"
|
|
[ -f "$archivo" ] || error "No está cargada la imagen $imagen ni existe $archivo"
|
|
aviso "Cargando $archivo"
|
|
gunzip -c "$archivo" | docker load
|
|
fi
|
|
done
|
|
|
|
mkdir -p "$ISSSTELEON_DATOS"
|
|
aviso "Datos en $ISSSTELEON_DATOS"
|
|
compose up -d --remove-orphans
|
|
esperar_api
|
|
ip="$(hostname -I 2>/dev/null | awk '{print $1}')"
|
|
aviso "Listo. Abra http://${ip:-localhost}:${ISSSTELEON_PUERTO:-8080} en el navegador."
|
|
aviso "Estado: ./estado.sh Respaldo: ./respaldar.sh"
|