bugfix persistent idhubs were not updating code
includes refactor of common functionality moved to build__common related, somehow, to #2
This commit is contained in:
parent
24739e3983
commit
cd796ce262
|
@ -26,15 +26,25 @@ common_start() {
|
||||||
fi
|
fi
|
||||||
)
|
)
|
||||||
|
|
||||||
# some targets might use idhub1 and/or idhub2
|
# process idhubs instances for the purpose
|
||||||
idhub="${idhub:-idhub__${target}}"
|
for idhub in ${idhubs}; do
|
||||||
idhub1="${idhub1:-idhub1__${target}}"
|
|
||||||
idhub2="${idhub2:-idhub2__${target}}"
|
|
||||||
|
|
||||||
if [ "${persistence}" = "n" ]; then
|
if [ "${persistence}" = "n" ]; then
|
||||||
# no data persistence: cleanup previous possible data
|
# no data persistence: cleanup previous possible data
|
||||||
rm -rf "./${idhub}"
|
rm -rf "./${idhub}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# detect existing deployment
|
||||||
|
if [ -d "./${idhub}" ]; then
|
||||||
|
git -C "${idhub}" pull
|
||||||
|
# looks new
|
||||||
|
else
|
||||||
|
echo "Detected new deployment, recreating git repos ${idhub}"
|
||||||
|
cp -rp IdHub "${idhub}"
|
||||||
|
# ensure the copy does not contain a DB
|
||||||
|
rm -f "${idhub}/db.sqlite3"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
common_end() {
|
common_end() {
|
||||||
|
|
|
@ -13,21 +13,13 @@ main() {
|
||||||
# common_end
|
# common_end
|
||||||
. ./build__common.sh
|
. ./build__common.sh
|
||||||
|
|
||||||
|
# vars used in common_start and end
|
||||||
target='instance-autotest'
|
target='instance-autotest'
|
||||||
|
|
||||||
idhub="idhub__${target}"
|
|
||||||
|
|
||||||
persistence='n'
|
persistence='n'
|
||||||
|
idhubs='idhub'
|
||||||
|
|
||||||
common_start
|
common_start
|
||||||
|
|
||||||
# detect if is new
|
|
||||||
if [ ! -f "./${idhub}" ]; then
|
|
||||||
echo 'Detected new deployment, recreating idhub git repo'
|
|
||||||
cp -rp IdHub "${idhub}"
|
|
||||||
rm -f "${idhub}/db.sqlite3"
|
|
||||||
fi
|
|
||||||
|
|
||||||
common_end
|
common_end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,17 +13,12 @@ main() {
|
||||||
# common_end
|
# common_end
|
||||||
. ./build__common.sh
|
. ./build__common.sh
|
||||||
|
|
||||||
|
# vars used in common_start and end
|
||||||
target='pilot-lafede'
|
target='pilot-lafede'
|
||||||
|
idhubs='idhub'
|
||||||
|
|
||||||
common_start
|
common_start
|
||||||
|
|
||||||
# detect if is new
|
|
||||||
if [ ! -f "./${idhub1}" ]; then
|
|
||||||
echo 'Detected new deployment, recreating idhub git repo'
|
|
||||||
cp -rp IdHub "${idhub1}"
|
|
||||||
rm -f "${idhub1}/db.sqlite3"
|
|
||||||
fi
|
|
||||||
|
|
||||||
common_end
|
common_end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,19 +13,12 @@ main() {
|
||||||
# common_end
|
# common_end
|
||||||
. ./build__common.sh
|
. ./build__common.sh
|
||||||
|
|
||||||
|
# vars used in common_start and end
|
||||||
target='pilot-pangea'
|
target='pilot-pangea'
|
||||||
|
idhubs='idhub1 idhub2'
|
||||||
|
|
||||||
common_start
|
common_start
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# common_end builds idhub
|
# common_end builds idhub
|
||||||
# these are extra builds specific for this pilot
|
# these are extra builds specific for this pilot
|
||||||
make musician_build
|
make musician_build
|
||||||
|
|
|
@ -13,19 +13,12 @@ main() {
|
||||||
# common_end
|
# common_end
|
||||||
. ./build__common.sh
|
. ./build__common.sh
|
||||||
|
|
||||||
|
# vars used in common_start and end
|
||||||
target='pilot-setem'
|
target='pilot-setem'
|
||||||
|
idhubs='idhub1 idhub2'
|
||||||
|
|
||||||
common_start
|
common_start
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
common_end
|
common_end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,19 +13,12 @@ main() {
|
||||||
# common_end
|
# common_end
|
||||||
. ./build__common.sh
|
. ./build__common.sh
|
||||||
|
|
||||||
|
# vars used in common_start and end
|
||||||
target='pilot-xo9b'
|
target='pilot-xo9b'
|
||||||
|
idhubs='idhub1 idhub2'
|
||||||
|
|
||||||
common_start
|
common_start
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
common_end
|
common_end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue