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 authentik
ssikit_trustchain ssikit_trustchain
idhub__*
idhub1__* idhub1__*
idhub2__* idhub2__*
idhub1__*

View file

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

View file

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