devicehub-django/docker-reset.sh
pedro 3d10217599 docker-reset: remove better the db
now that in db dir there are snapshots stored
2024-10-18 15:25:27 +02:00

28 lines
478 B
Bash
Executable file

#!/bin/sh
# Copyright (c) 2024 Pedro <copyright@cas.cat>
# SPDX-License-Identifier: AGPL-3.0-or-later
set -e
set -u
# DEBUG
set -x
main() {
cd "$(dirname "${0}")"
if [ "${DETACH:-}" ]; then
detach_arg='-d'
fi
# remove old database
sudo rm -vfr ./db/*
docker compose down -v
docker compose build
docker compose up ${detach_arg:-}
}
main "${@}"
# written in emacs
# -*- mode: shell-script; -*-