diff deploy/provision.d/050-webapp-db.sh @ 1589:94669513c53c dockerise

Docs etc
author Chris Cannam
date Thu, 17 Aug 2017 13:56:15 +0100
parents d8949733849d
children 83412a0a2389
line wrap: on
line diff
--- a/deploy/provision.d/050-webapp-db.sh	Thu Aug 17 12:06:04 2017 +0100
+++ b/deploy/provision.d/050-webapp-db.sh	Thu Aug 17 13:56:15 2017 +0100
@@ -2,14 +2,17 @@
 
 set -e
 
+# Copy across the database config file (the source file has presumably
+# been generated from a skeleton, earlier in provisioning)
+
 infile=/var/www/code/deploy/config/database.yml
+outfile=/var/www/code/config/database.yml
 
-if [ ! -f "$infile" ]; then
-    echo "ERROR: Database config file $infile not found - has the database secret been interpolated from $infile.in correctly?"
-    exit 2
+if [ ! -f "$outfile" ]; then
+    if [ ! -f "$infile" ]; then
+        echo "ERROR: Database config file $infile not found - has the database secret been interpolated from $infile.in correctly?"
+        exit 2
+    fi
+    cp "$infile" "$outfile"
 fi
 
-if [ ! -f /var/www/code/config/database.yml ]; then
-    cp "$infile" /var/www/code/config/database.yml
-fi
-