Skip to content
Closed
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
14 changes: 13 additions & 1 deletion taskfiles/utils-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ tasks:
label: "{{.TASK}}-{{.OUTPUT_FILE}}"
vars:
OUTPUT_FILE: "{{default (base .URL) .OUTPUT_FILE}}"
URL_FILE: "{{.OUTPUT_FILE | replace \".\" \"#\"}}.url"
requires:
vars: ["FILE_SHA256", "URL"]
generates: ["{{.OUTPUT_FILE}}"]
generates: ["{{.OUTPUT_FILE}}", "{{.URL_FILE}}"]
status:
- >-
diff
<(echo "{{.URL}}")
<(cat "{{.URL_FILE}}")
- >-
diff
<(echo "{{.FILE_SHA256}}")
Expand All @@ -26,6 +31,7 @@ tasks:
cmds:
- |-
mkdir -p "{{dir .OUTPUT_FILE}}"
echo "{{.URL}}" > "{{.URL_FILE}}"
max_attempts=3
attempt=1
while [ $attempt -le $max_attempts ]; do
Expand All @@ -47,6 +53,12 @@ tasks:
echo "Failed to download after $max_attempts attempts."
exit 1
fi
- "echo Verifying the commit hash of {{.OUTPUT_FILE}}."
- >-
diff
<(echo "{{.FILE_SHA256}}")
<(openssl dgst -sha256 "{{.OUTPUT_FILE}}"
| awk '{print $2}')
Comment thread
Bill-hbrhbr marked this conversation as resolved.

# Runs curl to download the tar file from the given URL and extracts its contents.
#
Expand Down