Allow db host, name user and password to be configurable

This commit is contained in:
Pan Luo committed 2016-04-15 21:31:28 -07:00
1 parent 483ff9040a
commit 031858fbae
3 files changed
+22 -7

No files matched your search

+11 -5
View File
@@ -1,6 +1,12 @@
export PGUSER=postgres
psql <<- EOSQL
CREATE DATABASE mattermost;
CREATE USER mmuser WITH PASSWORD 'mmuser_password';
GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser;
#!/bin/bash
set -e
MM_USERNAME=${MM_USERNAME:-mmuser}
MM_PASSWORD=${MM_PASSWORD:-mmuser_password}
MM_DBNAME=${MM_DBNAME:-mattermost}
psql -v ON_ERROR_STOP=1 --username "postgres" <<- EOSQL
CREATE DATABASE $MM_DBNAME;
CREATE USER $MM_USERNAME WITH PASSWORD '$MM_PASSWORD';
GRANT ALL PRIVILEGES ON DATABASE $MM_DBNAME to $MM_USERNAME;
EOSQL