Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain error when downloading Node Alpine ARM64 #4822

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vsts.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ parameters:
- name: alpine_arm64
type: boolean
displayName: Alpine (ARM64)
default: false
default: true
- name: macOS_x64
type: boolean
displayName: macOS (x64)
Expand Down
22 changes: 14 additions & 8 deletions src/Misc/externals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,20 @@ else
fi

function failed() {
local error=${1:-Undefined error}
echo "Failed: $error" >&2
exit 1
local error=${1:-Undefined error}
local command_identifier=$2
echo "Failed: $error" >&2
if [[ $command_identifier == 'download_node_alpine_arm64' ]]; then
echo "Node for Alpine ARM64 not found in blob storage. If the version of Node (for tasks execution) has been updated, it should be built for Alpine ARM64 and uploaded to blob storage. Read documentation about the agent release for more info."
fi
exit 1
}

function checkRC() {
local rc=$?
local command_identifier=$2
if [ $rc -ne 0 ]; then
failed "${1} failed with return code $rc"
failed "${1} failed with return code $rc" $command_identifier
fi
}

Expand All @@ -56,6 +61,7 @@ function acquireExternalTool() {
# of the nested TEE-CLC-14.0.4 directory are moved up one directory, and then the empty directory
# TEE-CLC-14.0.4 is removed.
local dont_uncompress=$4
local tool_name=$5

# Extract the portion of the URL after the protocol. E.g. vstsagenttools.blob.core.windows.net/tools/pdbstr/1/pdbstr.zip
local relative_url="${download_source#*://}"
Expand Down Expand Up @@ -84,7 +90,7 @@ function acquireExternalTool() {
# -S Show error. With -s, make curl show errors when they occur
# -L Follow redirects (H)
# -o FILE Write to FILE instead of stdout
curl --retry 10 -fkSL -o "$partial_target" "$download_source" 2>"${download_target}_download.log" || checkRC 'curl'
curl --retry 10 -fkSL -o "$partial_target" "$download_source" 2>"${download_target}_download.log" || checkRC 'curl' "download_${tool_name}"

# Move the partial file to the download target.
mv "$partial_target" "$download_target" || checkRC 'mv'
Expand Down Expand Up @@ -205,11 +211,11 @@ else
ARCH="linux-arm64-musl"

if [[ "$INCLUDE_NODE10" == "true" ]]; then
acquireExternalTool "${CONTAINER_URL}/nodejs/${ARCH}/node-v${NODE10_VERSION}-${ARCH}.tar.gz" node10/bin fix_nested_dir
acquireExternalTool "${CONTAINER_URL}/nodejs/${ARCH}/node-v${NODE10_VERSION}-${ARCH}.tar.gz" node10/bin fix_nested_dir false node_alpine_arm64
fi

acquireExternalTool "${CONTAINER_URL}/nodejs/${ARCH}/node-v${NODE16_VERSION}-${ARCH}.tar.gz" node16/bin fix_nested_dir
acquireExternalTool "${CONTAINER_URL}/nodejs/${ARCH}/node-v${NODE20_VERSION}-${ARCH}.tar.gz" node20_1/bin fix_nested_dir
acquireExternalTool "${CONTAINER_URL}/nodejs/${ARCH}/node-v${NODE16_VERSION}-${ARCH}.tar.gz" node16/bin fix_nested_dir false node_alpine_arm64
acquireExternalTool "${CONTAINER_URL}/nodejs/${ARCH}/node-v${NODE20_VERSION}-${ARCH}.tar.gz" node20_1/bin fix_nested_dir false node_alpine_arm64
else
case $PACKAGERUNTIME in
"linux-musl-x64") ARCH="linux-x64-musl";;
Expand Down
Loading