2021-07-15 11:21:48 +02:00
|
|
|
#!/bin/bash -e
|
2022-09-20 07:32:48 +02:00
|
|
|
################################################################################
|
|
|
|
|
## File: yq.sh
|
|
|
|
|
## Desc: Installs YQ
|
2023-11-02 15:40:32 +01:00
|
|
|
## 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
|
|
|
|
|
|
2023-11-02 15:40:32 +01:00
|
|
|
# Download YQ
|
|
|
|
|
base_url="https://github.com/mikefarah/yq/releases/latest/download"
|
|
|
|
|
download_with_retries "${base_url}/yq_linux_amd64" "/tmp" "yq"
|
|
|
|
|
# Supply chain security - YQ
|
|
|
|
|
external_hash=$(get_hash_from_remote_file "${base_url}/checksums" "yq_linux_amd64 " "" " " "19")
|
|
|
|
|
use_checksum_comparison "/tmp/yq" "${external_hash}"
|
|
|
|
|
# Install YQ
|
|
|
|
|
sudo install /tmp/yq /usr/bin/yq
|
2021-07-15 11:21:48 +02:00
|
|
|
|
|
|
|
|
invoke_tests "Tools" "yq"
|