diff --git a/postdeploy.sh b/postdeploy.sh index 8f7abb8..b2bfc28 100755 --- a/postdeploy.sh +++ b/postdeploy.sh @@ -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