Skip to content

Commit

Permalink
fix init_db.sql to also take variables from environment (#556)
Browse files Browse the repository at this point in the history
* fix init_db.sql to also take variables from environment

* make other occurrences of username dynamic

* Update docker/init_db.sql

Co-authored-by: Lari Hotari <[email protected]>
  • Loading branch information
Mortom123 and lhotari authored Apr 3, 2024
1 parent 0c87834 commit 3e5430c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docker/init_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
-- limitations under the License.
--

ALTER USER pulsar WITH PASSWORD 'pulsar';
CREATE DATABASE pulsar_manager OWNER pulsar;
GRANT ALL PRIVILEGES ON DATABASE pulsar_manager to pulsar;
\set username `echo "${USERNAME:-pulsar}"`
\set password `echo "${PASSWORD:-pulsar}"`

ALTER USER :username WITH PASSWORD :'password';
CREATE DATABASE pulsar_manager OWNER :username;
GRANT ALL PRIVILEGES ON DATABASE pulsar_manager to :username;

\c pulsar_manager;

Expand Down

0 comments on commit 3e5430c

Please sign in to comment.