aboutsummaryrefslogtreecommitdiffstats
path: root/etc/taskcluster/curl-artifact.sh
blob: 3093eca4a878276fefb67d2cfc2b6ebbb9f5582e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

set -o errexit
set -o nounset
set -o pipefail

task_id="${1}"
artifact="${2}"
shift 2
queue="https://queue.taskcluster.net/v1"
url="${queue}/task/${task_id}/artifacts/public/${artifact}"
echo "Fetching ${url}" >&2
curl \
    --retry 5 \
    --connect-timeout 10 \
    --location \
    --fail \
    "${url}" \
    "${@}"