annotate scripts/pull-updates.sh @ 49:757f89c5a19c

add script to pull updated ssdt app images
author smith@nwoca.org
date Mon, 22 Feb 2016 17:23:18 +0000
parents
children
rev   line source
49
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
1 #
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
2 # Pulls updates from upstream repository for images matching filter. The
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
3 # default filter pulls all ssdt application images.
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
4 #
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
5 # Usage:
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
6 # pull-updates.sh [application] [filter]
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
7 #
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
8 # defaults:
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
9 # application=all applications
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
10 # filter=label=io.ssdt.app[=application]
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
11 #
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
12 # Note: if filter is provided, the first argument is ignored. A complete filter must be supplied.
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
13 #
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
14 APP=${1:+=$1}
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
15 FILTER=${2:-label=io.ssdt.app$APP}
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
16 while read -a line
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
17 do
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
18 repo=${line[0]}
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
19 tag=${line[1]}
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
20 if [[ $repo == docker.ssdt.io* ]]
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
21 then
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
22 echo "docker pull ${repo}:${tag}"
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
23 docker pull ${repo}:${tag}
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
24 fi
757f89c5a19c add script to pull updated ssdt app images
smith@nwoca.org
parents:
diff changeset
25 done < <(docker images --filter "$FILTER")