Skip to content

cli.db: Open init-admin subcmd to initialize superuser-level scripts

In staging, the db is already created by puppet (with necessary users, etc...).

The current create database cli swh db create does not work currently. The subsequent steps of postgresql extensions installation is required though (and it's currently stuck on the creation step failing).

This commit allows to use the init-admin to just install those extensions (and eventually add/update existing/new ones).

In future diffs, we could also fallback to the postgresql image ability to create the database during its initialization (and then drop the current if db exists instruction in our entrypoint scripts). D4377 demonstrates such a behavior \o/

Related to swh/infra/sysadm-environment#2736 (closed)

Test Plan

current tox is happy

(I'll investigate later on how properly test those cli #2741 (closed) -> !184 (closed)).


Migrated from D4374 (view on Phabricator)

Merge request reports