Wrap all scripts in check

This commit is contained in:
Luke Murphy 2020-03-12 18:03:10 +01:00
parent 31684dd77e
commit bf75a7b7ee
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 6 additions and 8 deletions

View File

@ -5,10 +5,8 @@ set -eu -o pipefail
setup_db() {
set -eu
if [ -f "/data/gitea/conf/app.ini" ]; then
echo "====> Running database migration"
gitea migrate
fi
echo "====> Running database migration"
gitea migrate
}
setup_root_user() {
@ -18,8 +16,6 @@ setup_root_user() {
if [[ "${user_count}" == "0" ]]; then
echo "====> Setting up root user for first run"
if gitea admin create-user --username "$ADMIN_USER" --password "$ADMIN_PASS" --email "$ADMIN_MAIL" --admin; then
echo "====> root user added"
else
@ -32,8 +28,10 @@ setup_root_user() {
main() {
set -eu
setup_db
setup_root_user
if [ -f "/data/gitea/conf/app.ini" ]; then
setup_db
setup_root_user
fi
}
main