comparison scripts/exec-all-projects.sh @ 187:6b950e1a95e6

DEP-12: update exec script.
author smith@nwoca.org
date Wed, 20 Sep 2017 16:57:30 +0100
parents 620ea742f1df
children fea886ba7279
comparison
equal deleted inserted replaced
186:620ea742f1df 187:6b950e1a95e6
8 # the second paramter specifies the command to execute against each 8 # the second paramter specifies the command to execute against each
9 # compose project. 9 # compose project.
10 ## 10 ##
11 11
12 : ${1?"Usage: {parent path} [command]"} 12 : ${1?"Usage: {parent path} [command]"}
13 COMMAND=${2:-*app}
14 13
15 ORIGINALDIR=$PWD 14 ORIGINALDIR=$PWD
16 PARENTDIR=$1 15 PARENTDIR=$1
16
17 shift
18 COMMAND=$@
17 19
18 for f in $(find $PARENTDIR -name docker-compose.yml) 20 for f in $(find $PARENTDIR -name docker-compose.yml)
19 do 21 do
20 projectdir=`dirname $f` 22 projectdir=`dirname $f`
21 project=`basename $projectdir` 23 project=`basename $projectdir`
22 cd $projectdir 24 cd $projectdir
23 echo -e "----\n$executing $COMMAND on $project" 25 echo -e "----\n$executing $COMMAND on $project \n----"
24 26
25 bash -c ${COMMAND} 27 bash -c "${COMMAND}"
28 echo ""
26 29
27 done 30 done
28 31
29 cd $ORIGINALDIR 32 cd $ORIGINALDIR