changes to allow a reset
This commit is contained in:
+23
-1
@@ -66,7 +66,7 @@ if (!appDb.getUser(appUser)) {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[WARNUNG] App-User konnte nicht synchronisiert werden; der bestehende Mongo-Volume-Stand verwendet wahrscheinlich andere Root-Credentials." >&2
|
echo "[WARNUNG] App-User konnte nicht synchronisiert werden; der bestehende Mongo-Volume-Stand verwendet wahrscheinlich andere Root-Credentials. Falls das ein frischer Dev-Stand ist, starte mit MONGO_RESET_DATA=1 neu." >&2
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,6 +133,26 @@ compose() {
|
|||||||
"${DOCKER_CMD[@]}" compose --env-file "$SECRETS_FILE" "$@"
|
"${DOCKER_CMD[@]}" compose --env-file "$SECRETS_FILE" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_truthy() {
|
||||||
|
case "${1:-}" in
|
||||||
|
1|true|TRUE|yes|YES|on|ON)
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
reset_mongo_data_if_requested() {
|
||||||
|
if ! is_truthy "${MONGO_RESET_DATA:-0}"; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "[WARNUNG] Setze den MongoDB-Volume-Stand zurück, damit die aktuellen Secrets neu initialisiert werden." >&2
|
||||||
|
"${DOCKER_CMD[@]}" compose --env-file "$SECRETS_FILE" down -v --remove-orphans
|
||||||
|
}
|
||||||
|
|
||||||
build_website_image() {
|
build_website_image() {
|
||||||
if compose build website; then
|
if compose build website; then
|
||||||
return 0
|
return 0
|
||||||
@@ -163,6 +183,8 @@ fi
|
|||||||
|
|
||||||
resolve_docker_cmd
|
resolve_docker_cmd
|
||||||
|
|
||||||
|
reset_mongo_data_if_requested
|
||||||
|
|
||||||
build_website_image
|
build_website_image
|
||||||
compose up -d mongodb
|
compose up -d mongodb
|
||||||
wait_for_mongo_ready
|
wait_for_mongo_ready
|
||||||
|
|||||||
Reference in New Issue
Block a user