Skip to content

Commit cfcb8ac

Browse files
authored
[NotationV0] bump: bump up notation version to v1.1.0 (#19468)
* bump: bump up notation version to v1.1.0 Signed-off-by: Junjie Gao <[email protected]> * fix: bump up task version Signed-off-by: Junjie Gao <[email protected]> * fix: bump up task version Signed-off-by: Junjie Gao <[email protected]> * fix: update code Signed-off-by: Junjie Gao <[email protected]> --------- Signed-off-by: Junjie Gao <[email protected]>
1 parent b078a6d commit cfcb8ac

File tree

7 files changed

+119
-45
lines changed

7 files changed

+119
-45
lines changed

Tasks/NotationV0/README.md

+3-39
Original file line numberDiff line numberDiff line change
@@ -18,42 +18,6 @@ It transfers the trust store and trust policy from the user's code repository to
1818
- public network access for downloading Notation CLI and Notation Azure Key Vault plugin from Github releases.
1919
- Supported OS: Linux x64/ARM64, Windows x64, macOS x64/ARM64
2020

21-
# User Documents
22-
- [Notation sign on ADO pipeline](./docs/sign-images-pipeline.md)
23-
24-
## Inputs
25-
`command` - Command
26-
`string`. Required. Allowed values: `install`, `sign` and `verify`.
27-
28-
`artifactRefs` - Artifact References
29-
`string`. The container artifact reference with digest. If multiple references are used, please use comma to separate them. If it was not specified, the task will automatically detect it from previous Docker task.
30-
31-
`plugin` - Plugin
32-
`string`. Required for sign command. Allowed values: `azureKeyVault`.
33-
34-
`akvPluginVersion` - Azure Key Vault Plugin Version
35-
`string`. Required for `azureKeyVault` plugin. The version for Azure Key Vault plugin. Please visit the [release page](https://github.com/Azure/notation-azure-kv/releases) to choose a released version.
36-
37-
`azurekvServiceConnection` - Azure Key Vault Service Connection
38-
`string`. Required for `azure-kv` plugin. Select the The Azure Resource Manager service connection for the key vault if prefer to use service connection for authentication.
39-
40-
`keyid` - Key ID
41-
`string`. Required for `azure-kv` plugin. The key identifier of an Azure Key Vault certificate.
42-
43-
`selfSigned` - Self signed
44-
`boolean`. Whether the certficate is self-signed certificate.
45-
46-
`caCertBundle` - Certificate Bundle File Path
47-
`string`. The certificate bundle file containing intermidiate certificates and root certificate.
48-
49-
`trustPolicy` - Trust Policy File Path
50-
`string`. Required for `verify` command. The trust policy file path.
51-
52-
`trustStore` - Trust Store Folder Path
53-
`string`. Requried for `verify` command. The trust store folder path.
54-
55-
`signatureFormat` - Signature Format
56-
`string`. Signature envelope format. Allowed values: `jws`, `cose`.
57-
58-
`allowReferrersAPI` - [Experimental] Allow Referrers API
59-
`boolean`. Use the Referrers API to sign signatures, if not supported (returns 404), fallback to the Referrers tag schema.
21+
## Bump up notation version
22+
1. Run ./scripts/generate_checksum.py to update the ./data/notation_versions.json file.
23+
2. Update the task.json and task.loc.json default version to be the latest version.

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": "a190962ca09a24d814916e26c8f98d01c1891fd0bae6192355675b8b16e38726",
6+
"url": "https://github.com/notaryproject/notation/releases/download/v1.1.0/notation_1.1.0_darwin_amd64.tar.gz"
7+
},
8+
"arm64": {
9+
"checksum": "295df24d247f4b276bd1ee04ae5f639b8feadebd68c01be1821c0b94cbd5cf75",
10+
"url": "https://github.com/notaryproject/notation/releases/download/v1.1.0/notation_1.1.0_darwin_arm64.tar.gz"
11+
}
12+
},
13+
"linux": {
14+
"amd64": {
15+
"checksum": "0e31e156edff6cc324405cda391d7144b0b99c265a7bdfa6644f457e530fe6d4",
16+
"url": "https://github.com/notaryproject/notation/releases/download/v1.1.0/notation_1.1.0_linux_amd64.tar.gz"
17+
},
18+
"arm64": {
19+
"checksum": "8c01a8f52356b15ce2c69be4cea193c56d092f913482d2e4a4d90ad6ec81fe64",
20+
"url": "https://github.com/notaryproject/notation/releases/download/v1.1.0/notation_1.1.0_linux_arm64.tar.gz"
21+
}
22+
},
23+
"version": "1.1.0",
24+
"windows": {
25+
"amd64": {
26+
"checksum": "397b5ccc27d8f890f955f1e91f8fb21e4c23995ec8f5a42257e72a14728bd4d5",
27+
"url": "https://github.com/notaryproject/notation/releases/download/v1.1.0/notation_1.1.0_windows_amd64.zip"
28+
}
29+
}
30+
},
231
{
332
"darwin": {
433
"amd64": {

Tasks/NotationV0/package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tasks/NotationV0/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "notation",
3-
"version": "0.232.0",
3+
"version": "0.235.0",
44
"description": "Azure Pipepine Task for setting up Notation CLI, sign and verify with Notation",
55
"main": "src/index.js",
66
"scripts": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# This script reads a checksums.txt file and generates a JSON file containing
2+
# the checksums and URLs for each file. The generated JSON file is then merged
3+
# with an existing JSON file containing previous checksums. If the version
4+
# already exists in the existing JSON file, an exception is raised.
5+
#
6+
# Usage: python generate_checksum.py <checksums.txt> <old_checksums.json>
7+
#
8+
# checksums.txt format:
9+
# 2ef0560c3c88908a22d1f302e5b0119160e72380e25fb58c2d7b153e9397a04c notation_1.0.0-rc.1_linux_arm64.tar.gz
10+
# 3b5239d68810fec349807aa9eb90fcb9cd972cdb540ecfd4fcf3631d7ad4be06 notation_1.0.0-rc.1_darwin_amd64.tar.gz
11+
# 7607c8de3b6c1435b2dc4c012e9c0486849ce7b4b5e0fbbee2dd9ed7aab084a7 notation_1.0.0-rc.1_linux_amd64.tar.gz
12+
# 7d091cbd62886d1b47b60519a5b56314e794caf18751b1cccab2f54387a0d5c4 notation_1.0.0-rc.1_windows_amd64.zip
13+
# eaa7b0c7c8d18e504766ce8d3ac5e46da2e97f4fdcead8be997e0ae74b146b00 notation_1.0.0-rc.1_darwin_arm64.tar.gz
14+
#
15+
# Note: This script may be integrated to pipeline in the future.
16+
#
17+
import os
18+
import sys
19+
import json
20+
21+
def build_url(name, version, filename):
22+
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}'
25+
}[name]()
26+
27+
def process_checksum(filepath):
28+
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]
40+
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+
}
49+
50+
return verionInfo
51+
52+
def update_checksums(filepath, checksums):
53+
# read old checksums
54+
versionList = []
55+
if os.path.exists(filepath):
56+
f = open(filepath, 'r')
57+
versionList = json.load(f)
58+
f.close()
59+
60+
# check if version exists
61+
for versionInfo in versionList:
62+
if versionInfo['version'] == checksums['version']:
63+
raise Exception(f'Version {checksums["version"]} already exists in {filepath}')
64+
65+
# update checksums
66+
with open(filepath, 'w') as f:
67+
json.dump([checksums] + versionList, f, indent=4, sort_keys=True)
68+
69+
def main():
70+
if len(sys.argv) < 3:
71+
print('Usage: python generate_checksum.py <checksums.txt> <old_checksums.json>')
72+
sys.exit(1)
73+
74+
filepath = sys.argv[1]
75+
old_checksums = sys.argv[2]
76+
77+
checksums = process_checksum(filepath)
78+
update_checksums(old_checksums, checksums)
79+
80+
if __name__ == '__main__':
81+
main()

Tasks/NotationV0/task.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"minimumAgentVersion": "2.144.0",
1111
"version": {
1212
"Major": 0,
13-
"Minor": 232,
13+
"Minor": 235,
1414
"Patch": 0
1515
},
1616
"groups": [
@@ -61,7 +61,7 @@
6161
"name": "version",
6262
"type": "string",
6363
"label": "Version",
64-
"defaultValue": "1.0.1",
64+
"defaultValue": "1.1.0",
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",

Tasks/NotationV0/task.loc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"minimumAgentVersion": "2.144.0",
1111
"version": {
1212
"Major": 0,
13-
"Minor": 232,
13+
"Minor": 235,
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.0.1",
64+
"defaultValue": "1.1.0",
6565
"required": true,
6666
"helpMarkDown": "ms-resource:loc.input.help.version",
6767
"visibleRule": "command = install && isCustomVersion = false",

0 commit comments

Comments
 (0)