Wrap all scripts in check
This commit is contained in:
parent
31684dd77e
commit
bf75a7b7ee
@ -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
|
||||
|
Reference in New Issue
Block a user