2024-09-20 15:19:12 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Copyright (c) 2024 Pedro <copyright@cas.cat>
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -u
|
|
|
|
# DEBUG
|
2024-09-20 15:28:48 +00:00
|
|
|
set -x
|
2024-09-20 15:19:12 +00:00
|
|
|
|
|
|
|
main() {
|
2024-10-16 18:39:57 +00:00
|
|
|
cd "$(dirname "${0}")"
|
|
|
|
|
2024-09-26 23:06:37 +00:00
|
|
|
if [ "${DETACH:-}" ]; then
|
|
|
|
detach_arg='-d'
|
|
|
|
fi
|
2024-11-08 14:55:04 +00:00
|
|
|
|
|
|
|
if [ ! -f .env ]; then
|
|
|
|
cp -v .env.example .env
|
|
|
|
echo "WARNING: .env was not there, .env.example was copied, this only happens once"
|
|
|
|
fi
|
2024-09-20 15:19:12 +00:00
|
|
|
# remove old database
|
2024-11-27 08:31:13 +00:00
|
|
|
rm -vfr ./db/*
|
2024-09-28 15:11:20 +00:00
|
|
|
docker compose down -v
|
2024-09-20 15:19:12 +00:00
|
|
|
docker compose build
|
2024-09-26 23:06:37 +00:00
|
|
|
docker compose up ${detach_arg:-}
|
2024-09-20 15:19:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
main "${@}"
|
|
|
|
|
|
|
|
# written in emacs
|
|
|
|
# -*- mode: shell-script; -*-
|