Skip to content

Commit 1c4ff5c

Browse files
Added ability to update multiple versions of variants
1 parent 718e718 commit 1c4ff5c

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

update.sh

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ function usage() {
77
Update the node docker images.
88
99
Usage:
10-
$0 [-s] [MAJOR_VERSION] [VARIANT]
10+
$0 [-s] [MAJOR_VERSION(S)] [VARIANT(S)]
1111
1212
Examples:
13-
- update.sh # Update all images
14-
- update.sh -s # Update all images, skip updating Alpine and Yarn
15-
- update.sh 8 # Update version 8 and variants (default, slim, alpine etc.)
16-
- update.sh -s 8 # Update version 8 and variants, skip updating Alpine and Yarn
17-
- update.sh 8 slim # Update all variants for version 8
18-
- update.sh -s 8 slim # Update all variants for version 8, skip updating Alpine and Yarn
13+
- update.sh # Update all images
14+
- update.sh -s # Update all images, skip updating Alpine and Yarn
15+
- update.sh 8,9 # Update version 8 and 9 and variants (default, slim, alpine etc.)
16+
- update.sh -s 8 # Update version 8 and variants, skip updating Alpine and Yarn
17+
- update.sh 8 slim,stretch # Update only slim and stretch variants for version 8
18+
- update.sh -s 8 slim,stretch # Update only slim and stretch variants for version 8, skip updating Alpine and Yarn
1919
2020
OPTIONS:
2121
-s Security update; skip updating the yarn and alpine versions.
@@ -46,9 +46,12 @@ done
4646

4747
cd "$(cd "${0%/*}" && pwd -P)"
4848

49+
IFS=',' read -ra versions_arg <<<"${1:-}"
50+
IFS=',' read -ra variant_arg <<<"${2:-}"
51+
4952
IFS=' ' read -ra versions <<<"$(get_versions .)"
50-
IFS=' ' read -ra update_versions <<<"$(get_versions . "${1-}")"
51-
IFS=' ' read -ra update_variants <<<"$(get_variants . "${2-}")"
53+
IFS=' ' read -ra update_versions <<<"$(get_versions . "${versions_arg[@]:-}")"
54+
IFS=' ' read -ra update_variants <<<"$(get_variants . "${variant_arg[@]:-}")"
5255
if [ ${#versions[@]} -eq 0 ]; then
5356
fatal "No valid versions found!"
5457
fi

0 commit comments

Comments
 (0)