diff scripts/.functions.sh @ 85:8f45c43ea7a4 feature/djs-DEP-12-docker

DEP-12: start upgrading scripts and compose files for RC and docker 1.12
author Dave Smith <smith@nwoca.org>
date Wed, 21 Sep 2016 19:00:41 -0400
parents 85957628f4c0
children c029be781d13
line wrap: on
line diff
--- a/scripts/.functions.sh	Wed Sep 21 19:00:11 2016 -0400
+++ b/scripts/.functions.sh	Wed Sep 21 19:00:41 2016 -0400
@@ -1,4 +1,6 @@
 #!/bin/bash
+export SSDT_SCRIPTS=$(dirname "${BASH_SOURCE[0]}")
+export SSDT_HOME=$(dirname $SSDT_SCRIPTS)
 
 # deletes psql data from specified service
 resetDbVolume() {
@@ -26,4 +28,10 @@
    container=$(composeGetContainer $service)
 
    echo "$2" | docker exec -i $container  sh -c "gosu postgres psql \$DB_NAME"
-}
\ No newline at end of file
+}
+
+composeGetProject() {  
+  service=${1?"Must supply service from current project"}
+  container=$(composeGetContainer $service)
+  echo $(docker inspect -f '{{index .Config.Labels "com.docker.compose.project" }}' $container)
+}