20 lines
1.1 KiB
Bash
Executable File
20 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
task_root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
|
|
source "$task_root/toolchain.lock.env"
|
|
[[ $(uname -sm) == 'Linux x86_64' ]] || { echo 'Phase 0 tools require Linux x86_64.' >&2; exit 1; }
|
|
for task_tool in curl bsdtar sha256sum; do command -v "$task_tool" >/dev/null; done
|
|
mkdir -p "$task_root/.tools/packwiz"
|
|
if [[ ! -f "$task_root/.tools/packwiz/packwiz" ]]; then
|
|
curl -fsSL --retry 2 "$PACKWIZ_URL" -o "$task_root/.tools/packwiz/packwiz.zip"
|
|
printf '%s %s\n' "$PACKWIZ_ARCHIVE_SHA256" "$task_root/.tools/packwiz/packwiz.zip" | sha256sum -c -
|
|
bsdtar -xf "$task_root/.tools/packwiz/packwiz.zip" -C "$task_root/.tools/packwiz"
|
|
fi
|
|
if [[ ! -f "$task_root/.tools/docker-compose" ]]; then
|
|
curl -fsSL --retry 2 "$COMPOSE_URL" -o "$task_root/.tools/docker-compose"
|
|
fi
|
|
printf '%s %s\n' "$PACKWIZ_BINARY_SHA256" "$task_root/.tools/packwiz/packwiz" | sha256sum -c -
|
|
printf '%s %s\n' "$COMPOSE_SHA256" "$task_root/.tools/docker-compose" | sha256sum -c -
|
|
chmod +x "$task_root/.tools/packwiz/packwiz" "$task_root/.tools/docker-compose"
|
|
"$task_root/.tools/docker-compose" version
|