From dc5629af30ce2a4948a2fe2a94f6937ba311cf72 Mon Sep 17 00:00:00 2001 From: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> Date: Mon, 9 Mar 2026 19:16:20 +0100 Subject: [PATCH] fix: modify update.sh script fix log statement Dockerfile updated / not updated remove -s option remove -b option from help correct and update example options to use current Node.js versions and latest Debian release --- update.sh | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/update.sh b/update.sh index c30b6b3088..9444558eb6 100755 --- a/update.sh +++ b/update.sh @@ -11,29 +11,21 @@ function usage() { $0 [-s] [MAJOR_VERSION(S)] [VARIANT(S)] Examples: - - update.sh # Update all images - - update.sh -s # Update all images, skip updating Alpine and Yarn - - update.sh 8,10 # Update all variants of version 8 and 10 - - update.sh -s 8 # Update version 8 and variants, skip updating Alpine and Yarn - - update.sh 8 alpine # Update only alpine's variants for version 8 - - update.sh -s 8 bullseye # Update only bullseye variant for version 8, skip updating Alpine and Yarn - - update.sh . alpine # Update the alpine variant for all versions + - update.sh # Update all images + - update.sh 24 # Update all variants of version 24 + - update.sh 22,24 # Update all variants of version 22 and 24 + - update.sh 24 alpine3.23 # Update only alpine3.23's variants for version 24 + - update.sh 24 trixie,trixie-slim # Update only trixie & trixie-slim variants for version 24 + - update.sh . trixie # Update the trixie variant for all versions OPTIONS: - -s Security update; skip updating the yarn and alpine versions. - -b CI config update only -h Show this message EOF } -SKIP=false -while getopts "sh" opt; do +while getopts "h" opt; do case "${opt}" in - s) - SKIP=true - shift - ;; h) usage exit @@ -65,9 +57,7 @@ fi # TODO: Should be able to specify target architecture manually arch=$(get_arch) -if [ "${SKIP}" != true ]; then - yarnVersion="$(curl -sSL --compressed https://yarnpkg.com/latest-version)" -fi +yarnVersion="$(curl -sSL --compressed https://yarnpkg.com/latest-version)" function in_versions_to_update() { local version=$1 @@ -134,6 +124,9 @@ function update_node_version() { sed -Ei -e 's/^FROM (.*)/FROM '"$fromprefix"'\1/' "${dockerfile}-tmp" sed -Ei -e 's/^(ENV NODE_VERSION)=.*/\1='"${nodeVersion}"'/' "${dockerfile}-tmp" + currentYarnVersion="$(grep "ENV YARN_VERSION" "${dockerfile}" | cut -d'=' -f2)" + sed -Ei -e 's/^(ENV YARN_VERSION=).*/\1'"${currentYarnVersion}"'/' "${dockerfile}-tmp" + # shellcheck disable=SC1004 new_line=' \\\ ' @@ -168,9 +161,7 @@ function update_node_version() { if diff -q "${dockerfile}-tmp" "${dockerfile}" > /dev/null; then echo "${dockerfile} is already up to date!" else - if [ "${SKIP}" != true ]; then - sed -Ei -e 's/^(ENV YARN_VERSION)=.*/\1='"${yarnVersion}"'/' "${dockerfile}-tmp" - fi + sed -Ei -e 's/^(ENV YARN_VERSION=).*/\1'"${yarnVersion}"'/' "${dockerfile}-tmp" echo "${dockerfile} updated!" fi