From 2d3b74e18250620d799952f46935c780ef7249e3 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Tue, 22 Oct 2024 09:18:08 +0200 Subject: [PATCH 1/3] fix: correct update script to support version argument again --- functions.sh | 8 ++++++-- update.sh | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/functions.sh b/functions.sh index bee3dafe0..f16aeabdb 100755 --- a/functions.sh +++ b/functions.sh @@ -137,12 +137,16 @@ function get_config() { # # The result is a list of valid versions. function get_versions() { + shift + local versions=() - local dirs=() + local dirs=("$@") local default_variant default_variant=$(get_config "./" "default_variant") - IFS=' ' read -ra dirs <<< "$(echo "./"*/)" + if [ ${#dirs[@]} -eq 0 ]; then + IFS=' ' read -ra dirs <<< "$(echo "./"*/)" + fi for dir in "${dirs[@]}"; do if [ -a "${dir}/Dockerfile" ] || [ -a "${dir}/${default_variant}/Dockerfile" ]; then diff --git a/update.sh b/update.sh index 0b6aaf69d..cd73b6e22 100755 --- a/update.sh +++ b/update.sh @@ -189,6 +189,8 @@ function update_node_version() { ) } +pids=() + for version in "${versions[@]}"; do parentpath=$(dirname "${version}") versionnum=$(basename "${version}") @@ -201,8 +203,6 @@ for version in "${versions[@]}"; do # See details in function.sh IFS=' ' read -ra variants <<< "$(get_variants "${parentpath}")" - pids=() - if [ -f "${version}/Dockerfile" ]; then if [ "${update_version}" -eq 0 ]; then update_node_version "${baseuri}" "${versionnum}" "${parentpath}/Dockerfile.template" "${version}/Dockerfile" & From 1b2a07635994e5a2cfd4dcaf92811c19a05c70f1 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Tue, 22 Oct 2024 09:29:48 +0200 Subject: [PATCH 2/3] chore: simplify update script slightly --- build-automation.mjs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build-automation.mjs b/build-automation.mjs index 9a085826b..ba296d1ed 100644 --- a/build-automation.mjs +++ b/build-automation.mjs @@ -87,13 +87,13 @@ export default async function(github) { } else { const newVersions = await checkForMuslVersionsAndSecurityReleases(github, versions); let updatedVersions = []; - for (let version of Object.keys(newVersions)) { - if (newVersions[version].muslBuildExists) { - const { stdout } = await exec(`./update.sh ${newVersions[version].isSecurityRelease ? "-s " : ""}${version}`); + for (const [version, newVersion] of Object.entries(newVersions)) { + if (newVersion.muslBuildExists) { + const { stdout } = await exec(`./update.sh ${newVersion.isSecurityRelease ? "-s " : ""}${version}`); console.log(stdout); - updatedVersions.push(newVersions[version].fullVersion); + updatedVersions.push(newVersion.fullVersion); } else { - console.log(`There's no musl build for version ${newVersions[version].fullVersion} yet.`); + console.log(`There's no musl build for version ${newVersion.fullVersion} yet.`); process.exit(0); } } From df448135e673997cc2f2fbfd9ccc4a5fed3682e9 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Fri, 25 Oct 2024 08:56:32 +0200 Subject: [PATCH 3/3] disable shellcheck rule --- functions.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/functions.sh b/functions.sh index f16aeabdb..7c927cc08 100755 --- a/functions.sh +++ b/functions.sh @@ -136,6 +136,7 @@ function get_config() { # Get available versions for a given path # # The result is a list of valid versions. +# shellcheck disable=SC2120 function get_versions() { shift