From f8c446ce74329fc5844e0fc1fd82e618242196f4 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Thu, 28 Mar 2019 03:33:14 -0500 Subject: migrate and revert executable, query insert and delete test --- postgres/bootstrap.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'postgres') diff --git a/postgres/bootstrap.sh b/postgres/bootstrap.sh index 391aeab..070e104 100644 --- a/postgres/bootstrap.sh +++ b/postgres/bootstrap.sh @@ -10,8 +10,12 @@ apt-get install -y xauth apt-get install -y postgresql postgresql-client pgadmin3 # set up db -sudo -u postgres psql -c "CREATE USER space WITH PASSWORD 'space';" -sudo -u postgres psql -c "CREATE DATABASE space_db WITH OWNER space;" +USERNAME=$(grep POSTGRES_USERNAME /vagrant/src/constants.rs | cut -d '"' -f2) +PASSWORD=$(grep POSTGRES_PASSWORD /vagrant/src/constants.rs | cut -d '"' -f2) +DB_NAME=$(grep POSTGRES_DB_NAME /vagrant/src/constants.rs | cut -d '"' -f2) + +sudo -u postgres psql -c "CREATE USER $USERNAME WITH PASSWORD '$PASSWORD';" +sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $USERNAME;" # copy configs cp /vagrant/postgres/*conf /etc/postgresql/9.6/main/ -- cgit v1.2.3