X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=XTesting%2Fkubespray%2Fscripts%2Fdownload_hash.sh;fp=XTesting%2Fkubespray%2Fscripts%2Fdownload_hash.sh;h=e15dc2affbf4c24d400a38cd82ddf33dd3dfe8d4;hb=31af17bb5935b722dcf59d5800aaff9e789cfa93;hp=0000000000000000000000000000000000000000;hpb=c8bda4f07b7e87beb2aa3d8729f9b0b456d4da6f;p=it%2Ftest.git diff --git a/XTesting/kubespray/scripts/download_hash.sh b/XTesting/kubespray/scripts/download_hash.sh new file mode 100644 index 0000000..e15dc2a --- /dev/null +++ b/XTesting/kubespray/scripts/download_hash.sh @@ -0,0 +1,28 @@ +#!/bin/sh +set -eo pipefail + +VERSIONS="$@" +ARCHITECTURES="arm arm64 amd64 ppc64le" +DOWNLOADS="kubelet kubectl kubeadm" +DOWNLOAD_DIR="tmp/kubeadm_hasher" + +if [ -z "$VERSIONS" ]; then + echo "USAGE: $0 " + exit 1 +fi + +mkdir -p ${DOWNLOAD_DIR} +for download in ${DOWNLOADS}; do + echo -e "\n\n${download}_checksums:" + for arch in ${ARCHITECTURES}; do + echo -e " ${arch}:" + for version in ${VERSIONS}; do + TARGET="${DOWNLOAD_DIR}/${download}-$version-$arch" + if [ ! -f ${TARGET} ]; then + curl -L -f -S -s -o ${TARGET} "https://storage.googleapis.com/kubernetes-release/release/${version}/bin/linux/${arch}/${download}" + fi + echo -e " ${version}: $(sha256sum ${TARGET} | awk '{print $1}')" + done + done +done +echo -e "\n\nAdd these values to roles/download/defaults/main.yml"