superlint/scripts/install-arm-ttk.sh
Brett Logan 5224656969 Push scripts into standalone files
Pushes inline scripts in the Dockerfile into standalone
scripts and authenticates requests to GitHub using a
Personal Access Token to reduce build flakiness due
to GitHub's abuse and ratelimiting due to unauthenticated
reuests.

Signed-off-by: Brett Logan <lindluni@github.com>
2023-01-04 20:17:46 -05:00

17 lines
652 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
# Depends on PowerShell
# Reference https://github.com/Azure/arm-ttk
# Reference https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/test-toolkit
url=$(curl -s \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
https://api.github.com/repos/Azure/arm-ttk/releases/latest | jq -r '.tarball_url')
curl --retry 5 --retry-delay 5 -sL \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
"${url}" | tar -xz -C /usr/lib/microsoft
ln -sTf /usr/lib/microsoft/arm-ttk-master/arm-ttk/arm-ttk.psd1 /usr/bin/arm-ttk