Files
nomad/enos/modules/fetch_artifactory/scripts/install.sh
Tim Gross f0d3c2834e upgrade testing: add README and fix authorization header (#25059)
Add a README describing the setup required for running upgrade testing via
Enos. Also fix the authorization header of our `wget` to use the proper header
for short-lived tokens, and the output path variable of the artifactory step.

Co-authored-by: Juanadelacuesta <8647634+Juanadelacuesta@users.noreply.github.com>
2025-02-12 08:56:47 -05:00

27 lines
525 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
set -xeuo pipefail
wget --header="Authorization: Bearer $TOKEN" -O "$LOCAL_ZIP" "$URL"
if [ $? -eq 0 ]; then
echo "File downloaded successfully: $LOCAL_ZIP"
else
echo "Error downloading file." >&2
exit 1
fi
mkdir -p "$BINARY_PATH"
unzip -o "$LOCAL_ZIP" -d "$BINARY_PATH"
if [ $? -eq 0 ]; then
echo "File unzipped successfully to $BINARY_PATH"
else
echo "Error unzipping file." >&2
exit 1
fi
rm "$LOCAL_ZIP"