env var idhub could be used

instance autotest starts using it
This commit is contained in:
pedro 2024-02-05 20:48:20 +01:00
parent cde51c5103
commit 68f9a64e4c
3 changed files with 7 additions and 6 deletions

2
.gitignore vendored
View File

@ -9,6 +9,6 @@ IdHub
authentik
ssikit_trustchain
idhub__*
idhub1__*
idhub2__*
idhub1__*

View File

@ -26,6 +26,7 @@ common_start() {
)
# some targets might use idhub1 and/or idhub2
idhub="${idhub:-idhub__${target}}"
idhub1="${idhub1:-idhub1__${target}}"
idhub2="${idhub2:-idhub2__${target}}"
}

View File

@ -15,18 +15,18 @@ main() {
target='instance-autotest'
idhub1="idhub__${target}"
idhub="idhub__${target}"
common_start
# no data persistence: cleanup previous possible data
rm -rf "./${idhub1}" "./${idhub2}"
rm -rf "./${idhub}"
# detect if is new
if [ ! -f "./${idhub1}" ]; then
if [ ! -f "./${idhub}" ]; then
echo 'Detected new deployment, recreating idhub git repo'
cp -rp IdHub "${idhub1}"
rm -f "${idhub1}/db.sqlite3"
cp -rp IdHub "${idhub}"
rm -f "${idhub}/db.sqlite3"
fi
common_end