Add current context and confirmation dialog to reset/bootstrap methods (#887)
This commit is contained in:
parent
d7c19c7613
commit
52acd831cd
23
btrix
23
btrix
@ -90,12 +90,25 @@ runNightlyTests() {
|
|||||||
|
|
||||||
microk8s=false
|
microk8s=false
|
||||||
|
|
||||||
|
CONTEXT=$(cat ~/.kube/config | grep "current-context:" | sed "s/current-context: //")
|
||||||
|
|
||||||
if [[ $(microk8s) ]]; then
|
if [[ $(microk8s) ]]; then
|
||||||
microk8s=true
|
microk8s=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# bootstrap: build frontend and backend, upgrade and wait until ready
|
# bootstrap: build frontend and backend, upgrade and wait until ready
|
||||||
if [[ $1 = "bootstrap" ]]; then
|
if [[ $1 = "bootstrap" ]]; then
|
||||||
|
|
||||||
|
echo "Current context: $CONTEXT"
|
||||||
|
echo "Are you sure you want to update this context?"
|
||||||
|
if [[ "$(read -e -p '[y/N] > '; echo $REPLY)" == [Yy]* ]] ; then
|
||||||
|
echo Continuing
|
||||||
|
else
|
||||||
|
echo Stopping
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ "$microk8s" = true ] ; then
|
if [ "$microk8s" = true ] ; then
|
||||||
bootstrapMicrok8s
|
bootstrapMicrok8s
|
||||||
else
|
else
|
||||||
@ -113,6 +126,16 @@ fi
|
|||||||
|
|
||||||
# reset: uninstall, delete data, then bootstrap
|
# reset: uninstall, delete data, then bootstrap
|
||||||
if [[ $1 = "reset" ]]; then
|
if [[ $1 = "reset" ]]; then
|
||||||
|
|
||||||
|
echo "Current context: $CONTEXT"
|
||||||
|
echo "Resetting k8s cluster will delete the database. Are you sure you want to do this?"
|
||||||
|
if [[ "$(read -e -p '[y/N] > '; echo $REPLY)" == [Yy]* ]] ; then
|
||||||
|
echo Continuing
|
||||||
|
else
|
||||||
|
echo Stopping
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$microk8s" = true ] ; then
|
if [ "$microk8s" = true ] ; then
|
||||||
resetMicrok8s
|
resetMicrok8s
|
||||||
bootstrapMicrok8s
|
bootstrapMicrok8s
|
||||||
|
Loading…
Reference in New Issue
Block a user