diff options
author | jade <lix@jade.fyi> | 2024-06-09 08:28:52 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@localhost> | 2024-06-09 08:28:52 +0000 |
commit | 7dfa2a761ef8856454d8f63eda27edb8984bdc98 (patch) | |
tree | 310486149aa9955676a0ee43eca0b873357962b7 /releng/keys.py | |
parent | 28a079f841834ac11105ce5762115904d1e40ce1 (diff) | |
parent | 98e847514795f53f485b6dbd029ecb545ce38236 (diff) |
Merge changes from topic "releng" into main
* changes:
releng: support pushing the manual to docs also
Expose officialRelease from the flake
Put into place initial release engineering
Diffstat (limited to 'releng/keys.py')
-rw-r--r-- | releng/keys.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/releng/keys.py b/releng/keys.py new file mode 100644 index 000000000..14cff44dd --- /dev/null +++ b/releng/keys.py @@ -0,0 +1,19 @@ +import subprocess +import json +from . import environment + + +def get_ephemeral_key( + env: environment.RelengEnvironment) -> environment.S3Credentials: + output = subprocess.check_output([ + 'ssh', '-l', 'root', environment.S3_HOST, 'garage-ephemeral-key', + 'new', '--name', f'releng-{env.name}', '--read', '--write', + '--age-secs', '3600', + env.releases_bucket.removeprefix('s3://'), + env.cache_bucket.removeprefix('s3://'), + env.docs_bucket.removeprefix('s3://'), + ]) + d = json.loads(output.decode()) + return environment.S3Credentials(name=d['name'], + id=d['id'], + secret_key=d['secret_key']) |