-
Notifications
You must be signed in to change notification settings - Fork 11
/
pull_images
executable file
·41 lines (32 loc) · 1.08 KB
/
pull_images
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# make bash behave
set -euo pipefail
IFS=$'\n\t'
pgversions='10 11 12 13'
topdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
dockerfiles_dir="${topdir}/dockerfiles"
badusage=64
nprocs="${1:-1}"
declare args
while read -r line; do
IFS=',' read -r os release <<< "$line"
if [[ "${os}" = 'debian' ]] || [[ "${os}" = 'ubuntu' ]]; then
tag="${os}-${release}-all"
args+="pull citus/packaging:${tag}\n"
elif [[ "${os}" = 'centos' ]] || [[ "${os}" = 'fedora' ]] || [[ "${os}" = 'oraclelinux' ]]; then
# redhat variants need an image for each PostgreSQL version
IFS=' '
for pgversion in ${pgversions}; do
pgshort=${pgversion//./}
tag="${os}-${release}-pg${pgshort}"
args+="pull citus/packaging:${tag}\n"
done
elif [[ "${os}" = 'pgxn' ]]; then
tag="${os}-all"
args+="pull citus/packaging:${tag}\n"
else
echo "$0: unrecognized OS -- ${os}" >&2
exit $badusage
fi
done <"${topdir}/os-list.csv"
echo -e "${args}" | xargs -t -L1 -P "${nprocs}" docker