Skip to content

Commit

Permalink
Merge pull request #2156 from nodejs/fix-update-script
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterDaveHello authored Dec 29, 2024
2 parents 59baa0a + df44813 commit 41d0d0d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
10 changes: 5 additions & 5 deletions build-automation.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
9 changes: 7 additions & 2 deletions functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,18 @@ 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

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
Expand Down
4 changes: 2 additions & 2 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ function update_node_version() {
)
}

pids=()

for version in "${versions[@]}"; do
parentpath=$(dirname "${version}")
versionnum=$(basename "${version}")
Expand All @@ -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" &
Expand Down

0 comments on commit 41d0d0d

Please sign in to comment.