stages/ostree.remotes: support gpgkeypath
OSTree remotes can be configured to import keys from a file on disk or a directory containing multiple keys. When specified, explicitly enables gpg-verify=true.
This commit is contained in:
parent
135b20a487
commit
2bff83364b
1 changed files with 13 additions and 1 deletions
|
|
@ -48,6 +48,13 @@ SCHEMA = """
|
|||
"description": "GPG keys for the remote to verify commits",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"gpgkeypaths": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Path to ASCII-armored GPG key or directory containing ASCII-armored GPG keys to import",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -77,9 +84,14 @@ def main(tree, options):
|
|||
url = remote["url"]
|
||||
branches = remote.get("branches", [])
|
||||
gpgkeys = remote.get("gpgkeys", [])
|
||||
gpgkeypaths = remote.get("gpgkeypaths", [])
|
||||
|
||||
extra_args = []
|
||||
if not gpgkeys:
|
||||
if gpgkeypaths:
|
||||
paths = ",".join(gpgkeypaths)
|
||||
extra_args.append(f"--set=gpgkeypath={paths}")
|
||||
extra_args.append("--set=gpg-verify=true")
|
||||
elif not gpgkeys:
|
||||
extra_args += ["--no-gpg-verify"]
|
||||
|
||||
ostree("remote", "add",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue