-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathftp_version.py
38 lines (34 loc) · 1.22 KB
/
ftp_version.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import requests
# find and save the current Github release
html = str(
requests.get('https://github.com/kubernetes/kubernetes/releases/latest')
.content)
index = html.find('Release ')
github_version = html[index + 20:index + 29].replace('<', '').replace(' ', '').replace('\\', '')
#Remover "x"
remove_element = "x"
for i in range(0,len(remove_element)):
github_version = github_version.replace(remove_element[i],"")
file = open('github_version.txt', 'w')
file.writelines(github_version)
file.close()
# find and save the current Bazel version on FTP server
html = str(
requests.get(
'https://oplab9.parqtec.unicamp.br/pub/ppc64el/kubectl/latest'
).content)
index = html.rfind('kubectl-')
ftp_version = html[index + 8:index + 15].replace('<', '').replace(' ', '').replace('\\', '')
file = open('ftp_version.txt', 'w')
file.writelines(ftp_version)
file.close()
# find and save the oldest Bazel version on FTP server
html = str(
requests.get(
'https://oplab9.parqtec.unicamp.br/pub/ppc64el/kubectl'
).content)
index = html.find('kubectl-')
delete = html[index + 8:index + 15].replace('<', '').replace(' ', '').replace('\\', '')
file = open('delete_version.txt', 'w')
file.writelines(delete)
file.close()