argos/deployment/deploy_opencdmp.sh

47 lines
1.1 KiB
Bash
Raw Normal View History

2024-05-13 15:30:25 +02:00
#!/bin/bash
set -e
docker-compose down
sudo rm -r ./storage/postgres/data
mkdir ./storage/postgres/data
sudo rm -r ./storage/elasticsearch
mkdir ./storage/elasticsearch
docker-compose up -d opencdmp.elasticsearch
function loading_icon() {
local load_interval="${1}"
local loading_message="${2}"
local elapsed=0
local loading_animation=( '—' "\\" '|' '/' )
echo -n "${loading_message} "
tput civis
trap "tput cnorm" EXIT
while [ "${load_interval}" -ne "${elapsed}" ]; do
for frame in "${loading_animation[@]}" ; do
printf "%s\b" "${frame}"
sleep 0.25
done
elapsed=$(( elapsed + 1 ))
done
printf " \b\n"
}
loading_icon 45 "Waiting for Elasticsearch to Startup!"
docker exec opencdmp.elasticsearch /usr/share/elasticsearch/config/index_init.sh
docker restart opencdmp.elasticsearch
docker-compose up -d opencdmp.postgres
loading_icon 20 "Waiting for PostgreSQL to Initialize!"
docker-compose up -d opencdmp.keycloak
loading_icon 60 "Waiting for Keycloak to Startup!"
docker-compose up -d