Skip to content

Commit 45ba95e

Browse files
Merge pull request #796 from LaurentGoderre/master
Improved the update script
2 parents 718e718 + 26f21a8 commit 45ba95e

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

update.sh

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ 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
19+
- update.sh . alpine # Update the alpine variant for all versions
1920
2021
OPTIONS:
2122
-s Security update; skip updating the yarn and alpine versions.
@@ -46,9 +47,12 @@ done
4647

4748
cd "$(cd "${0%/*}" && pwd -P)"
4849

50+
IFS=',' read -ra versions_arg <<<"${1:-}"
51+
IFS=',' read -ra variant_arg <<<"${2:-}"
52+
4953
IFS=' ' read -ra versions <<<"$(get_versions .)"
50-
IFS=' ' read -ra update_versions <<<"$(get_versions . "${1-}")"
51-
IFS=' ' read -ra update_variants <<<"$(get_variants . "${2-}")"
54+
IFS=' ' read -ra update_versions <<<"$(get_versions . "${versions_arg[@]:-}")"
55+
IFS=' ' read -ra update_variants <<<"$(get_variants . "${variant_arg[@]:-}")"
5256
if [ ${#versions[@]} -eq 0 ]; then
5357
fatal "No valid versions found!"
5458
fi

0 commit comments

Comments
 (0)