diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2019-07-23 13:17:56 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2019-07-23 13:17:56 +0200 |
commit | 67f5d1008eef96f13dbf8910092155b7aa1bcee4 (patch) | |
tree | 00901863a6ab5c24c3e5616a9d4308499810c568 /terraform/ansible/k3s-refresh-releases | |
parent | ba76764c198e9232b3152568008d5aa5199a1fd0 (diff) | |
download | k8s-sandbox-67f5d1008eef96f13dbf8910092155b7aa1bcee4.tar.gz k8s-sandbox-67f5d1008eef96f13dbf8910092155b7aa1bcee4.tar.bz2 k8s-sandbox-67f5d1008eef96f13dbf8910092155b7aa1bcee4.tar.xz k8s-sandbox-67f5d1008eef96f13dbf8910092155b7aa1bcee4.zip |
o Merging in Terraform setup.
Diffstat (limited to 'terraform/ansible/k3s-refresh-releases')
-rwxr-xr-x | terraform/ansible/k3s-refresh-releases | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/terraform/ansible/k3s-refresh-releases b/terraform/ansible/k3s-refresh-releases new file mode 100755 index 0000000..ba8f7d6 --- /dev/null +++ b/terraform/ansible/k3s-refresh-releases @@ -0,0 +1,33 @@ +#!/bin/bash + +set -ueo pipefail +set -x + +#curl https://api.github.com/repos/rancher/k3s/releases > releases.json + +#function search { +# file=$1; shift +# checksum=$1; shift +# prog='.[]| {tag_name, assets:(.assets|.[]|{name,url:.browser_download_url} | select(.name==$file or .name==$checksum )) }' +# prog="$prog |[.tag_name,.assets.name,.assets.url]" +# cat releases.json |jq -r --arg file $file --arg checksum $checksum "$prog|@sh" +#} +# +#search k3s sha256sum-amd64.txt | while read file file_url checksum checksum_url + +function dl() { + v=$1; shift + echo " \"$v\":" + curl -s -L https://github.com/rancher/k3s/releases/download/v$v/sha256sum-amd64.txt | while read checksum file + do + url="https://github.com/rancher/k3s/releases/download/v$v/$file" + echo " \"$file\":" + echo " url: \"$url\"" + echo " checksum: \"$checksum\"" + done +} + +releases=ansible/roles/k3s/vars/k3s_releases.yml +echo "k3s__releases:" > $releases +dl 0.6.0 >> $releases +dl 0.7.0 >> $releases |