Files
runner-images-PK/images/linux/scripts/installers/oras-cli.sh
T

24 lines
945 B
Bash
Raw Normal View History

2020-10-07 13:49:40 +05:00
#!/bin/bash -e
2020-07-07 16:40:02 +03:00
################################################################################
## File: oras-cli.sh
2020-07-07 17:25:41 +03:00
## Desc: Installs ORAS CLI
## Supply chain security: ORAS CLI - checksum validation
2020-07-07 16:40:02 +03:00
################################################################################
2020-07-07 19:23:45 +03:00
source $HELPER_SCRIPTS/install.sh
2020-07-07 16:40:02 +03:00
# Determine latest ORAS CLI version
URL=$(get_github_package_download_url "oras-project/oras" "endswith(\"linux_amd64.tar.gz\")")
archive_name=$(basename "${URL}")
2020-07-07 16:40:02 +03:00
# Download ORAS CLI
download_with_retries "${URL}" "/tmp" "${archive_name}"
# Supply chain security - ORAS CLI
hash_url=$(get_github_package_download_url "oras-project/oras" "contains(\"checksums.txt\")")
external_hash=$(get_hash_from_remote_file "${hash_url}" "linux_amd64.tar.gz")
use_checksum_comparison "/tmp/${archive_name}" "${external_hash}"
# Unzip ORAS CLI
tar xzf "/tmp/${archive_name}" -C /usr/local/bin oras
2020-07-07 16:40:02 +03:00
invoke_tests "CLI.Tools" "Oras CLI"