Skip to content

Commit

Permalink
adding latest
Browse files Browse the repository at this point in the history
  • Loading branch information
clemenko committed Apr 17, 2024
1 parent a6831bb commit b7d892c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
22 changes: 17 additions & 5 deletions dzver/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ def json_all_the_things():

k3s_data = json.loads(requests.get("https://update.k3s.io/v1-release/channels").text)
k3s_out = json.dumps(k3s_data["data"][0]["latest"]).replace('"', '')

late_rke_data = json.loads(requests.get("https://update.rke2.io/v1-release/channels").text)
late_rke_out = json.dumps(late_rke_data["data"][1]["latest"]).replace('"', '')

late_k3s_data = json.loads(requests.get("https://update.k3s.io/v1-release/channels").text)
late_k3s_out = json.dumps(late_k3s_data["data"][1]["latest"]).replace('"', '')

cert_data = json.loads(requests.get("https://api.github.com/repos/cert-manager/cert-manager/releases/latest", headers=headers).text)
cert_out = json.dumps(cert_data["tag_name"]).replace('"', '')
Expand All @@ -42,6 +48,15 @@ def json_all_the_things():
def curl_all_the_things():
rke_data = json.loads(requests.get("https://update.rke2.io/v1-release/channels").text)
rke_out = json.dumps(rke_data["data"][0]["latest"]).replace('"', '')

k3s_data = json.loads(requests.get("https://update.k3s.io/v1-release/channels").text)
k3s_out = json.dumps(k3s_data["data"][0]["latest"]).replace('"', '')

late_rke_data = json.loads(requests.get("https://update.rke2.io/v1-release/channels").text)
late_rke_out = json.dumps(late_rke_data["data"][1]["latest"]).replace('"', '')

late_k3s_data = json.loads(requests.get("https://update.k3s.io/v1-release/channels").text)
late_k3s_out = json.dumps(late_k3s_data["data"][1]["latest"]).replace('"', '')

cert_data = json.loads(requests.get("https://api.github.com/repos/cert-manager/cert-manager/releases/latest", headers=headers).text)
cert_out = json.dumps(cert_data["tag_name"]).replace('"', '')
Expand All @@ -55,16 +70,13 @@ def curl_all_the_things():
neuvector_data = json.loads(requests.get("https://api.github.com/repos/neuvector/neuvector/releases/latest", headers=headers).text)
neuvector_out = json.dumps(neuvector_data["tag_name"]).replace('"', '')

harvester_data = json.loads(requests.get("https://api.github.com/repos/harvester/harvester/releases/latest, headers=headers").text)
harvester_data = json.loads(requests.get("https://api.github.com/repos/harvester/harvester/releases/latest", headers=headers).text)
harvester_out = json.dumps(harvester_data["tag_name"]).replace('"', '')

hauler_data = json.loads(requests.get("https://api.github.com/repos/rancherfederal/hauler/releases/latest", headers=headers).text)
hauler_out = json.dumps(hauler_data["tag_name"]).replace('"', '')

k3s_data = json.loads(requests.get("https://update.k3s.io/v1-release/channels").text)
k3s_out = json.dumps(k3s_data["data"][0]["latest"]).replace('"', '')

return render_template('index.html', rancher_ver=rancher_out, rke2_ver=rke_out, k3s_ver=k3s_out, longhorn_ver=longhorn_out, neu_ver=neuvector_out, cert_ver=cert_out, harv_ver=harvester_out, hauler_ver=hauler_out)
return render_template('index.html', rancher_ver=rancher_out, rke2_ver=rke_out, late_rke_ver=late_rke_ver, late_k3s_ver=late_k3s_out, k3s_ver=k3s_out, longhorn_ver=longhorn_out, neu_ver=neuvector_out, cert_ver=cert_out, harv_ver=harvester_out, hauler_ver=hauler_out)

if __name__ == '__main__':
app.run(host='0.0.0.0',debug=False)
12 changes: 10 additions & 2 deletions dzver/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@ <h2>Latest Rancher Stack Versions</h2>
<table class="table">
<tbody>
<tr>
<td>Rke2</td>
<td>Rke2 - Stable</td>
<td>{{rke2_ver}}</td>
</tr>
<tr>
<td>K3s</td>
<td>Rke2 - Latest</td>
<td>{{late_rke2_ver}}</td>
</tr>
<tr>
<td>K3s - Stable</td>
<td>{{k3s_ver}}</td>
</tr>
<tr>
<td>K3s - Latest</td>
<td>{{late_k3s_ver}}</td>
</tr>
<tr>
<td>Rancher</td>
<td>{{rancher_ver}}</td>
Expand Down

0 comments on commit b7d892c

Please sign in to comment.