Files
runner-images/images/ubuntu/scripts/build/install-yq.sh
T

24 lines
915 B
Bash
Raw Normal View History

2021-07-15 11:21:48 +02:00
#!/bin/bash -e
2022-09-20 07:32:48 +02:00
################################################################################
2023-11-22 21:49:23 +01:00
## File: install-yq.sh
## Desc: Install yq - a command-line YAML, JSON and XML processor
## Supply chain security: yq - checksum validation
2022-09-20 07:32:48 +02:00
################################################################################
2021-07-15 11:21:48 +02:00
# Source the helpers for use with the script
source $HELPER_SCRIPTS/install.sh
# Download yq
2023-12-29 12:36:27 +01:00
yq_url=$(resolve_github_release_asset_url "mikefarah/yq" "endswith(\"yq_linux_amd64\")" "latest")
binary_path=$(download_with_retry "${yq_url}")
# Supply chain security - yq
2023-12-29 12:36:27 +01:00
hash_url=$(resolve_github_release_asset_url "mikefarah/yq" "endswith(\"checksums\")" "latest")
external_hash=$(get_checksum_from_url "${hash_url}" "yq_linux_amd64 " "SHA256" "true" " " "19")
use_checksum_comparison "$binary_path" "$external_hash"
# Install yq
2023-12-29 12:36:27 +01:00
install "$binary_path" /usr/bin/yq
2021-07-15 11:21:48 +02:00
invoke_tests "Tools" "yq"