Rework configuration handling

This commit is contained in:
Rikard Bartholf
2016-02-17 12:22:22 +01:00
parent 3c3baf9712
commit a0e99a7e2a
4 changed files with 11 additions and 8 deletions
-7
View File
@@ -1,7 +0,0 @@
#!/bin/bash
# localhost
export PSQL_OPTS="-h localhost -U root"
# Prod
#export PSQL_OPTS="-h PRODUCTION.SERVER.URL -U root"
#export DB_NAME=DATABASE_NAME
+1
View File
@@ -1 +1,2 @@
.configuration.sh
env/*.conf
+7 -1
View File
@@ -1,6 +1,12 @@
#!/bin/bash
set -e
source .configuration.sh
DB_ENVIRONMENT=$1
if [ -z $DB_ENVIRONMENT ] ; then
DB_ENVIRONMENT="default"
fi
source env/$DB_ENVIRONMENT.conf
function add-version() {
psql $PSQL_OPTS -c "update database_versions set is_active = false where is_active = true" $DB_NAME
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
export PSQL_OPTS="-h localhost -U root"
export DB_NAME=photowall