diff scripts/exec-all-projects.sh @ 191:fea886ba7279

DEP-12: add source for .functions.sh to all scripts using compose
author smith@nwoca.org
date Wed, 20 Sep 2017 17:56:23 +0100
parents 6b950e1a95e6
children f6bea554980e
line wrap: on
line diff
--- a/scripts/exec-all-projects.sh	Wed Sep 20 17:41:25 2017 +0100
+++ b/scripts/exec-all-projects.sh	Wed Sep 20 17:56:23 2017 +0100
@@ -7,8 +7,27 @@
 # 
 # the second paramter specifies the command to execute against each
 # compose project.
+#
+# examples:
+#
+#   /ssdt/scripts/exec-all-projects.sh /data/pilot docker-compose ps
+# 
+#     executes "docker-compose ps" against all projects under /data/pilot
+#
+#   /ssdt/scripts/exec-all-projects.sh /data/pilot /ssdt/ /ssdt/scripts/backup-usas.sh
+#
+#     runs backup-usas.sh script against all projects under /data/pilot
+#
+#   /ssdt/scripts/exec-all-projects.sh /data/pilot "/ssdt/scripts/capture.sh | /ssdt/scripts/send.sh -"
+#
+#       captures the log files from all containers and sends one long file per project 
+#       to the SSDT support server.
+#
+#
 ##
 
+source "${SSDT_SCRIPTS:-$(dirname "${BASH_SOURCE[0]}")}/.functions.sh"
+
 : ${1?"Usage: {parent path} [command]"}
 
 ORIGINALDIR=$PWD
@@ -23,10 +42,10 @@
    project=`basename $projectdir`
    cd $projectdir
    echo -e "----\n$executing $COMMAND on $project \n----"      
-   
+
    bash -c "${COMMAND}"
    echo ""
-   
+
 done
 
 cd $ORIGINALDIR