Skip to content

Commit c51b91b

Browse files
authored
[NotationV0] bump: notation v1.1.1 and azure-kv plugin v1.2.0 (#20000)
* bump: notation v1.1.1 and azure-kv plugin v1.2.0 Signed-off-by: Junjie Gao <[email protected]> * bump: bump up version Signed-off-by: Junjie Gao <[email protected]> --------- Signed-off-by: Junjie Gao <[email protected]>
1 parent 41f4852 commit c51b91b

File tree

5 files changed

+110
-41
lines changed

5 files changed

+110
-41
lines changed

Tasks/NotationV0/data/azure_kv_versions.json

+29
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
11
[
2+
{
3+
"darwin": {
4+
"amd64": {
5+
"checksum": "4b5a3480fc1d6844a69f7d9483530e9be24a74441fd571ccd5eec9f6a5337eed",
6+
"url": "https://github.com/Azure/notation-azure-kv/releases/download/v1.2.0/notation-azure-kv_1.2.0_darwin_amd64.tar.gz"
7+
},
8+
"arm64": {
9+
"checksum": "2bcfc0ee3ad1cbb1854110e3f02b89d46c14feb5736de37cd237b9668f378f2f",
10+
"url": "https://github.com/Azure/notation-azure-kv/releases/download/v1.2.0/notation-azure-kv_1.2.0_darwin_arm64.tar.gz"
11+
}
12+
},
13+
"linux": {
14+
"amd64": {
15+
"checksum": "06bb5198af31ce11b08c4557ae4c2cbfb09878dfa6b637b7407ebc2d57b87b34",
16+
"url": "https://github.com/Azure/notation-azure-kv/releases/download/v1.2.0/notation-azure-kv_1.2.0_linux_amd64.tar.gz"
17+
},
18+
"arm64": {
19+
"checksum": "49520105bdb707a7bd3a519c55cc1541fbb336ab45b665c9cb2f84593f20ff29",
20+
"url": "https://github.com/Azure/notation-azure-kv/releases/download/v1.2.0/notation-azure-kv_1.2.0_linux_arm64.tar.gz"
21+
}
22+
},
23+
"version": "1.2.0",
24+
"windows": {
25+
"amd64": {
26+
"checksum": "4478b4a323363e264924349bf7007d4201621024b0f9252e0cfde42c0938c667",
27+
"url": "https://github.com/Azure/notation-azure-kv/releases/download/v1.2.0/notation-azure-kv_1.2.0_windows_amd64.zip"
28+
}
29+
}
30+
},
231
{
332
"darwin": {
433
"amd64": {

Tasks/NotationV0/data/notation_versions.json

+29
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
11
[
2+
{
3+
"darwin": {
4+
"amd64": {
5+
"checksum": "b336e7a13612b1aa52b5a682247a2742f0683f7adb7811a5ae35e75d04bf8e87",
6+
"url": "https://github.com/notaryproject/notation/releases/download/v1.1.1/notation_1.1.1_darwin_amd64.tar.gz"
7+
},
8+
"arm64": {
9+
"checksum": "e7a68e56736a9b435707326c61331e4402b90bb83154bee4ce6bf619efade28f",
10+
"url": "https://github.com/notaryproject/notation/releases/download/v1.1.1/notation_1.1.1_darwin_arm64.tar.gz"
11+
}
12+
},
13+
"linux": {
14+
"amd64": {
15+
"checksum": "de5f9845505b38fd30c2b1f4c2172ae517e3eba3e9836647f14525daa0f930c1",
16+
"url": "https://github.com/notaryproject/notation/releases/download/v1.1.1/notation_1.1.1_linux_amd64.tar.gz"
17+
},
18+
"arm64": {
19+
"checksum": "f035db321a112887dac1c2e7e9d0f60afa2e332174ab956ea6a901fc5488a218",
20+
"url": "https://github.com/notaryproject/notation/releases/download/v1.1.1/notation_1.1.1_linux_arm64.tar.gz"
21+
}
22+
},
23+
"version": "1.1.1",
24+
"windows": {
25+
"amd64": {
26+
"checksum": "bf4e928f43409b8b2ce640dc284f847b6de4e02c53f60b3171298bc28b296258",
27+
"url": "https://github.com/notaryproject/notation/releases/download/v1.1.1/notation_1.1.1_windows_amd64.zip"
28+
}
29+
}
30+
},
231
{
332
"darwin": {
433
"amd64": {

Tasks/NotationV0/scripts/generate_checksum.py

+46-35
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# with an existing JSON file containing previous checksums. If the version
44
# already exists in the existing JSON file, an exception is raised.
55
#
6-
# Usage: python generate_checksum.py <checksums.txt> <old_checksums.json>
6+
# Usage: python generate_checksum.py <checksums_download_url> <old_checksums.json>
77
#
88
# checksums.txt format:
99
# 2ef0560c3c88908a22d1f302e5b0119160e72380e25fb58c2d7b153e9397a04c notation_1.0.0-rc.1_linux_arm64.tar.gz
@@ -17,65 +17,76 @@
1717
import os
1818
import sys
1919
import json
20+
import requests
21+
22+
def download_file(url, dest_path):
23+
response = requests.get(url)
24+
if response.status_code == 200:
25+
with open(dest_path, 'wb') as f:
26+
f.write(response.content)
27+
return True
28+
else:
29+
return False
2030

2131
def build_url(name, version, filename):
2232
return {
23-
"notation": lambda : f'https://github.com/notaryproject/notation/releases/download/v{version}/{filename}',
24-
"notation-azure-kv": lambda :f'https://github.com/Azure/notation-azure-kv/releases/download/v{version}/{filename}'
33+
"notation": lambda: f'https://github.com/notaryproject/notation/releases/download/v{version}/{filename}',
34+
"notation-azure-kv": lambda: f'https://github.com/Azure/notation-azure-kv/releases/download/v{version}/{filename}'
2535
}[name]()
2636

27-
def process_checksum(filepath):
37+
def process_checksum(checksum_text):
2838
verionInfo = {}
29-
with open(filepath, 'r') as f:
30-
for line in f.readlines():
31-
line = line.rstrip('\n')
32-
parts = line.split(' ')
33-
checksum = parts[0]
34-
filename = parts[2]
35-
name_parts = filename.split('_')
36-
name = name_parts[0]
37-
version = name_parts[1]
38-
osName = name_parts[2]
39-
arch = name_parts[3].split('.')[0]
39+
for line in checksum_text.splitlines():
40+
line = line.rstrip('\n')
41+
parts = line.split(' ')
42+
checksum = parts[0]
43+
filename = parts[2]
44+
name_parts = filename.split('_')
45+
name = name_parts[0]
46+
version = name_parts[1]
47+
osName = name_parts[2]
48+
arch = name_parts[3].split('.')[0]
4049

41-
# generate checksum
42-
verionInfo.setdefault('version', version)
43-
verionInfo.setdefault(osName, {})
44-
verionInfo[osName].setdefault(arch, {})
45-
verionInfo[osName][arch] = {
46-
"url": build_url(name, version, filename),
47-
"checksum": checksum
48-
}
50+
verionInfo.setdefault('version', version)
51+
verionInfo.setdefault(osName, {})
52+
verionInfo[osName].setdefault(arch, {})
53+
verionInfo[osName][arch] = {
54+
"url": build_url(name, version, filename),
55+
"checksum": checksum
56+
}
4957

5058
return verionInfo
5159

5260
def update_checksums(filepath, checksums):
53-
# read old checksums
54-
versionList = []
5561
if os.path.exists(filepath):
56-
f = open(filepath, 'r')
57-
versionList = json.load(f)
58-
f.close()
62+
with open(filepath, 'r') as f:
63+
versionList = json.load(f)
64+
else:
65+
versionList = []
5966

60-
# check if version exists
6167
for versionInfo in versionList:
6268
if versionInfo['version'] == checksums['version']:
6369
raise Exception(f'Version {checksums["version"]} already exists in {filepath}')
6470

65-
# update checksums
6671
with open(filepath, 'w') as f:
6772
json.dump([checksums] + versionList, f, indent=4, sort_keys=True)
6873

6974
def main():
7075
if len(sys.argv) < 3:
71-
print('Usage: python generate_checksum.py <checksums.txt> <old_checksums.json>')
76+
print('Usage: python generate_checksum.py <checksums_download_url> <old_checksums.json>')
7277
sys.exit(1)
7378

74-
filepath = sys.argv[1]
79+
download_url = sys.argv[1]
7580
old_checksums = sys.argv[2]
7681

77-
checksums = process_checksum(filepath)
78-
update_checksums(old_checksums, checksums)
82+
response = requests.get(download_url)
83+
if response.status_code == 200:
84+
checksum_text = response.text
85+
checksums = process_checksum(checksum_text)
86+
update_checksums(old_checksums, checksums)
87+
print('Checksums updated successfully.')
88+
else:
89+
print('Failed to download checksum file.')
7990

8091
if __name__ == '__main__':
81-
main()
92+
main()

Tasks/NotationV0/task.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"minimumAgentVersion": "2.144.0",
1111
"version": {
1212
"Major": 0,
13-
"Minor": 240,
13+
"Minor": 241,
1414
"Patch": 0
1515
},
1616
"groups": [
@@ -61,7 +61,7 @@
6161
"name": "version",
6262
"type": "string",
6363
"label": "Version",
64-
"defaultValue": "1.1.0",
64+
"defaultValue": "1.1.1",
6565
"required": true,
6666
"helpMarkDown": "The version of Notation to install. Example: 1.0.0, 1, 1.0, 1.0.0",
6767
"visibleRule": "command = install && isCustomVersion = false",
@@ -136,7 +136,7 @@
136136
"name": "akvPluginVersion",
137137
"type": "string",
138138
"label": "Plugin Version",
139-
"defaultValue": "1.1.0",
139+
"defaultValue": "1.2.0",
140140
"required": true,
141141
"helpMarkDown": "The version of the Azure Key Vault plugin to be installed. please visit the [release page](https://github.com/Azure/notation-azure-kv/releases) for the available versions.",
142142
"visibleRule": "plugin = azureKeyVault",

Tasks/NotationV0/task.loc.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"minimumAgentVersion": "2.144.0",
1111
"version": {
1212
"Major": 0,
13-
"Minor": 240,
13+
"Minor": 241,
1414
"Patch": 0
1515
},
1616
"groups": [
@@ -61,7 +61,7 @@
6161
"name": "version",
6262
"type": "string",
6363
"label": "ms-resource:loc.input.label.version",
64-
"defaultValue": "1.1.0",
64+
"defaultValue": "1.1.1",
6565
"required": true,
6666
"helpMarkDown": "ms-resource:loc.input.help.version",
6767
"visibleRule": "command = install && isCustomVersion = false",
@@ -136,7 +136,7 @@
136136
"name": "akvPluginVersion",
137137
"type": "string",
138138
"label": "ms-resource:loc.input.label.akvPluginVersion",
139-
"defaultValue": "1.1.0",
139+
"defaultValue": "1.2.0",
140140
"required": true,
141141
"helpMarkDown": "ms-resource:loc.input.help.akvPluginVersion",
142142
"visibleRule": "plugin = azureKeyVault",

0 commit comments

Comments
 (0)