This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2024-01-12 09:30:55 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -u
|
|
|
|
# DEBUG
|
|
|
|
set -x
|
|
|
|
|
|
|
|
# a wallet and verifier idhub for pilot-setem
|
|
|
|
main() {
|
|
|
|
deployment="${1:-}"
|
|
|
|
|
|
|
|
# detach on production deployment
|
|
|
|
if [ "${deployment}" = 'prod' ]; then
|
|
|
|
detach='-d'
|
|
|
|
fi
|
|
|
|
|
|
|
|
# ensure uses pilot-setem branch
|
|
|
|
(
|
|
|
|
cd ./IdHub
|
|
|
|
git checkout pilot-setem
|
|
|
|
)
|
|
|
|
|
2024-01-16 10:19:55 +00:00
|
|
|
pilot='pilot-setem'
|
|
|
|
local idhub1="idhub1__${pilot}"
|
|
|
|
local idhub2="idhub2__${pilot}"
|
2024-01-12 09:30:55 +00:00
|
|
|
|
|
|
|
# force recreate
|
|
|
|
rm -rf "./${idhub1}" "./${idhub2}"
|
|
|
|
|
|
|
|
# detect if is new
|
|
|
|
if [ ! -f "./${idhub1}" ] && [ ! -f "./${idhub2}" ]; then
|
|
|
|
echo 'Detected new deployment, recreating git repos idhub1 and idhub2'
|
|
|
|
cp -rp IdHub "${idhub1}"
|
|
|
|
rm -f "${idhub1}/db.sqlite3"
|
|
|
|
cp -rp IdHub "${idhub2}"
|
|
|
|
rm -f "${idhub2}/db.sqlite3"
|
|
|
|
fi
|
|
|
|
|
2024-01-16 10:19:55 +00:00
|
|
|
idhub_dc_f="docker-compose__${pilot}.yml"
|
|
|
|
docker compose -p ${pilot} -f ${idhub_dc_f} down -v || true
|
2024-01-12 09:30:55 +00:00
|
|
|
make idhub_build \
|
2024-01-16 10:19:55 +00:00
|
|
|
&& docker compose -p ${pilot} -f ${idhub_dc_f} up ${detach:-}
|
2024-01-12 09:30:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
main "${@}"
|