changeset 271:0032d099a2d5 production v2.2.0

flow: Merged <release> 'v2.2.0' to <master> ('production').
author smith@nwoca.org
date Mon, 12 Nov 2018 21:24:15 +0000
parents 17894e17b6fd (current diff) db32d5c0a22f (diff)
children 614ca710021c
files
diffstat 2 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/.functions.sh	Thu Jul 26 14:27:43 2018 +0100
+++ b/scripts/.functions.sh	Mon Nov 12 21:24:15 2018 +0000
@@ -34,7 +34,6 @@
 # finds docker container for specified compose service 
 composeGetContainer() {
   service=${1?"Must supply service from current project"}
-
   container=$( docker-compose ps | cut -d " " -f 1 -s | grep _${service}_ )
   echo $container
 }
@@ -47,7 +46,6 @@
 }
 
 composeGetProject() {  
-  service=${1?"Must supply service from current project"}
-  container=$(composeGetContainer $service)
-  echo $(docker inspect -f '{{index .Config.Labels "com.docker.compose.project" }}' $container)
+  project=$( docker-compose ps | tail -n1 | cut -d "_" -f 1 -s )
+  echo $project
 }
--- a/scripts/backup-container.sh	Thu Jul 26 14:27:43 2018 +0100
+++ b/scripts/backup-container.sh	Mon Nov 12 21:24:15 2018 +0000
@@ -19,7 +19,7 @@
 mkdir -p ./backup
 backupFile=./backup/${container}.$(date +%Y-%m-%d-%H-%M-%S).backup
 
-project=$(composeGetProject $container)
+project=$(composeGetProject)
 
 if [ "$project" == "" ]; then
    echo "no project available"
@@ -31,7 +31,7 @@
 
 if [[ $( grep --count "CREATE TABLE" ${backupFile} ) -lt 200 || $( grep --count "PostgreSQL database dump complete" ${backupFile} ) -eq 0 ]]; then
    echo "ERROR: backup verification FAILED"
-   echo "ERROR:  $(tail ${backupFile})"
+   echo "ERROR: $(tail ${backupFile})"
    exit 1
 fi