github.com/techend/deis@v1.0.1-0.20141111224634-e0eee0392b8a/database/templates/reload (about) 1 #!/bin/bash 2 # 3 # This script is designed to be run inside the container 4 # 5 PATH=$PATH:/usr/lib/postgresql/9.3/bin 6 7 # provide defaults for required envvars 8 PG_CONFIG=${PG_CONFIG:-/etc/postgresql/9.3/main/postgresql.conf} 9 PG_LISTEN=${PG_LISTEN:-*} 10 11 # run idemptoent database configuration 12 sudo -i -u postgres psql postgres <<EOF 13 ALTER ROLE postgres WITH PASSWORD '{{ .deis_database_adminPass }}'; 14 CREATE ROLE {{ .deis_database_user }} WITH LOGIN; 15 ALTER ROLE {{ .deis_database_user }} WITH PASSWORD '{{ .deis_database_password }}'; 16 CREATE DATABASE {{ .deis_database_name }} WITH OWNER {{ .deis_database_user }}; 17 EOF 18 19 exit 0