forked from openimis/openimis-dist_dkr
-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy_openimis.sh
37 lines (32 loc) · 945 Bytes
/
deploy_openimis.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
34
35
#!/bin/bash
#rename .env
if [[ -f '.env' ]]
then
echo "Using existing env files"
else
echo "creating env files from example"
cp .env.example .env
cp .env.lightning.example .env.lightning
cp .env.openSearch.example .env.openSearch
fi
if [[ -f '.init.lock' ]]
then
echo "initialisation already done"
else
echo "initialisation"
docker compose up -d db
#set -a # automatically export all variables
source .env
source .env.lightning
#set +a
docker compose run -e PGPASSWORD=${POSTGRES_PASSWORD} --rm db createdb -h db -U ${POSTGRES_USER} ${POSTGRES_DB}
set -e
docker compose run --rm web mix ecto.migrate
docker compose run --rm web mix run imisSetupScripts/imisSetup.exs
#TODO init opensearch dashboard with API/ manage command
echo "connect to https://{DOMAIN}"
echo "then go to https://{DOMAIN}/opensearch"
echo "then go in manage / saved object / import to import the openSearch dashboard"
touch '.init.lock'
fi
docker compose up -d