changeset 284:d41836720ce4 production v2.3.0

flow: Merged <release> 'v2.3.0' to <master> ('production').
author smith@nwoca.org
date Thu, 15 Nov 2018 20:10:48 +0000
parents 5599ce0c5a50 (current diff) 506a21d8c89a (diff)
children cd2e677afa4e
files
diffstat 2 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/.functions.sh	Wed Nov 14 22:05:33 2018 +0000
+++ b/scripts/.functions.sh	Thu Nov 15 20:10:48 2018 +0000
@@ -34,7 +34,7 @@
 # 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}_ )
+  container=$( docker-compose ps -q $service | xargs docker inspect -f '{{.Name}}' | cut -d "/" -f 2 )
   echo $container
 }
 
@@ -46,6 +46,6 @@
 }
 
 composeGetProject() {  
-  project=$( docker-compose ps | tail -n1 | cut -d "_" -f 1 -s )
+  project=$(docker-compose ps -q | tail -n1 |  xargs docker inspect -f "{{ index .Config.Labels \"com.docker.compose.project\"}}" )
   echo $project
 }
--- a/scripts/backup-container.sh	Wed Nov 14 22:05:33 2018 +0000
+++ b/scripts/backup-container.sh	Thu Nov 15 20:10:48 2018 +0000
@@ -20,7 +20,6 @@
 backupFile=./backup/${container}.$(date +%Y-%m-%d-%H-%M-%S).backup
 
 echo "preparing to backup ${container} on current project at ${projectDir}:"
-docker-compose ps
 echo " "
 
 project=$(composeGetProject)