43 lines
988 B
Bash
Executable file
43 lines
988 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -e
|
|
set -u
|
|
# DEBUG
|
|
set -x
|
|
|
|
# a wallet and verifier idhub for pilot-lafede
|
|
main() {
|
|
deployment="${1:-}"
|
|
|
|
# detach on production deployment
|
|
if [ "${deployment}" = 'prod' ]; then
|
|
detach='-d'
|
|
fi
|
|
|
|
# ensure uses pilot-lafede branch
|
|
(
|
|
cd ./IdHub
|
|
git checkout pilot-lafede
|
|
)
|
|
|
|
pilot='pilot-lafede'
|
|
local idhub1="idhub1__${pilot}"
|
|
|
|
# force recreate
|
|
rm -rf "./${idhub1}"
|
|
|
|
# detect if is new
|
|
if [ ! -f "./${idhub1}" ]; then
|
|
echo 'Detected new deployment, recreating idhub git repo'
|
|
cp -rp IdHub "${idhub1}"
|
|
rm -f "${idhub1}/db.sqlite3"
|
|
fi
|
|
|
|
idhub_dc_f="docker-compose__${pilot}.yml"
|
|
docker compose -p ${pilot} -f ${idhub_dc_f} down -v || true
|
|
make idhub_build \
|
|
&& docker compose -p ${pilot} -f ${idhub_dc_f} up ${detach:-}
|
|
}
|
|
|
|
main "${@}"
|