44 lines
909 B
Bash
44 lines
909 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
set -e
|
||
|
set -u
|
||
|
# DEBUG
|
||
|
#set -x
|
||
|
|
||
|
common_start() {
|
||
|
figlet "${pilot}"
|
||
|
|
||
|
deployment="${1:-${deployment:-}}"
|
||
|
action="${action:-deploy}"
|
||
|
|
||
|
# detach on production deployment
|
||
|
if [ "${deployment}" = 'prod' ]; then
|
||
|
detach='-d'
|
||
|
fi
|
||
|
|
||
|
# ensure uses pilot-pangea branch
|
||
|
(
|
||
|
cd ./IdHub
|
||
|
git checkout ${pilot}
|
||
|
)
|
||
|
|
||
|
# some pilots might use idhub1 and/or idhub2
|
||
|
idhub1="idhub1__${pilot}"
|
||
|
idhub2="idhub2__${pilot}"
|
||
|
|
||
|
# force recreate
|
||
|
rm -rf "./${idhub1}" "./${idhub2}"
|
||
|
}
|
||
|
|
||
|
common_end() {
|
||
|
|
||
|
idhub_dc_f="docker-compose__${pilot}.yml"
|
||
|
docker compose -p ${pilot} -f ${idhub_dc_f} down -v || true
|
||
|
make idhub_build
|
||
|
|
||
|
if [ "${action:-}" = "deploy" ]; then
|
||
|
docker compose -p ${pilot} -f ${idhub_dc_f} up ${detach:-}
|
||
|
fi
|
||
|
|
||
|
}
|