Skip to content

Commit 3e5430c

Browse files
Mortom123lhotari
andauthored
fix init_db.sql to also take variables from environment (#556)
* 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 <lhotari@users.noreply.github.com>
1 parent 0c87834 commit 3e5430c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docker/init_db.sql

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
-- limitations under the License.
1313
--
1414

15-
ALTER USER pulsar WITH PASSWORD 'pulsar';
16-
CREATE DATABASE pulsar_manager OWNER pulsar;
17-
GRANT ALL PRIVILEGES ON DATABASE pulsar_manager to pulsar;
15+
\set username `echo "${USERNAME:-pulsar}"`
16+
\set password `echo "${PASSWORD:-pulsar}"`
17+
18+
ALTER USER :username WITH PASSWORD :'password';
19+
CREATE DATABASE pulsar_manager OWNER :username;
20+
GRANT ALL PRIVILEGES ON DATABASE pulsar_manager to :username;
1821

1922
\c pulsar_manager;
2023

0 commit comments

Comments
 (0)