comparison scripts/updates-apply.sh @ 264:3754be907d9b production vv2.1.0

flow: Merged <release> 'v2.1.0' to <master> ('production').
author aldrich@nwoca.org
date Thu, 26 Jul 2018 14:27:43 +0100
parents 6aecbb32c587
children
comparison
equal deleted inserted replaced
247:b8ee60469db7 264:3754be907d9b
10 # Only services which are currently running will be updated. 10 # Only services which are currently running will be updated.
11 # The script will not automatically start stopped services. 11 # The script will not automatically start stopped services.
12 # 12 #
13 # examples: 13 # examples:
14 # /ssdt/apply-updates.sh /data/preview 14 # /ssdt/apply-updates.sh /data/preview
15 # /ssdt/apply-updates.sh /data/preview usps 15 # /ssdt/apply-updates.sh /data/preview uspsapp
16 # 16 #
17 17
18 source "${SSDT_SCRIPTS:-$(dirname "${BASH_SOURCE[0]}")}/.functions.sh" 18 source "${SSDT_SCRIPTS:-$(dirname "${BASH_SOURCE[0]}")}/.functions.sh"
19 19
20 : ${1?"Usage: {parent path} [service]"} 20 : ${1?"Usage: {parent path} [service]"}
32 while read line 32 while read line
33 do 33 do
34 read container eol <<< $line 34 read container eol <<< $line
35 if [[ $container == *_1 ]] 35 if [[ $container == *_1 ]]
36 then 36 then
37 t=(${container//_/ }) 37 if [[ $eol =~ "Up" ]]
38 service=${t[1]}
39 if [[ $service == $SERVICE ]]
40 then 38 then
41 echo -e "\n$project: Updating $service" 39 t=(${container//_/ })
42 docker-compose up -d $service 40 service=${t[1]}
41 if [[ $service == $SERVICE ]]
42 then
43 echo -e "\n$project: Updating $service"
44 docker-compose up -d $service
45 fi
43 fi 46 fi
44 fi 47 fi
45 done < <(docker-compose ps) 48 done < <(docker-compose ps)
46 49
47 done 50 done