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.
idhub-docker/idhub_build_demo_12d.sh

36 lines
856 B
Bash
Raw Normal View History

2023-12-12 10:09:39 +00:00
#!/bin/sh
set -e
set -u
# DEBUG
set -x
# wallet and verifier idhub demo
main() {
deployment="${1:-}"
# detach on production deployment
if [ "${deployment}" = 'prod' ]; then
detach='-d'
fi
# 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
idhub_dc_f='docker-compose_idhub-demo-12d.yml'
docker compose -f ${idhub_dc_f} down -v || true
make idhub_build \
&& docker compose -f ${idhub_dc_f} up ${detach:-}
}
main "${@}"