aboutsummaryrefslogtreecommitdiff
path: root/terraform/ansible/k3s-refresh-releases
diff options
context:
space:
mode:
Diffstat (limited to 'terraform/ansible/k3s-refresh-releases')
-rwxr-xr-xterraform/ansible/k3s-refresh-releases33
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