aboutsummaryrefslogtreecommitdiff
path: root/releng/environment.py
diff options
context:
space:
mode:
authorJade Lovelace <lix@jade.fyi>2024-05-31 16:35:13 -0700
committerJade Lovelace <lix@jade.fyi>2024-06-06 20:53:08 -0700
commitc32a01f9ebae026c1b7b8ba081411581453b4624 (patch)
treec246e14bc178bfa1ea2ad6fe6487d80b528a31dc /releng/environment.py
parent611b1de441a54d3ed7781ca0a26b51b6cb9c45cc (diff)
Put into place initial release engineering
This can release x86_64-linux binaries to staging, with ephemeral keys. I think it's good enough to review at least at this point, so we don't keep adding more stuff to it to make it harder to review. Change-Id: Ie95e8f35d1252f5d014e819566f170b30eda152e
Diffstat (limited to 'releng/environment.py')
-rw-r--r--releng/environment.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/releng/environment.py b/releng/environment.py
new file mode 100644
index 000000000..643eb69d9
--- /dev/null
+++ b/releng/environment.py
@@ -0,0 +1,50 @@
+import dataclasses
+import urllib.parse
+
+S3_HOST = 's3.lix.systems'
+S3_ENDPOINT = 'https://s3.lix.systems'
+
+DEFAULT_STORE_URI_BITS = {
+ 'region': 'garage',
+ 'endpoint': 's3.lix.systems',
+ 'want-mass-query': 'true',
+ 'write-nar-listing': 'true',
+ 'ls-compression': 'zstd',
+ 'narinfo-compression': 'zstd',
+ 'compression': 'zstd',
+ 'parallel-compression': 'true',
+}
+
+
+@dataclasses.dataclass
+class RelengEnvironment:
+ name: str
+
+ aws_profile: str
+ cache_store_overlay: dict[str, str]
+ cache_bucket: str
+ releases_bucket: str
+ git_repo: str
+
+ def cache_store_uri(self):
+ qs = DEFAULT_STORE_URI_BITS.copy()
+ qs.update(self.cache_store_overlay)
+ return self.cache_bucket + "?" + urllib.parse.urlencode(qs)
+
+STAGING = RelengEnvironment(
+ name='staging',
+ aws_profile='garage_staging',
+ cache_bucket='s3://staging-cache',
+ cache_store_overlay={
+ 'secret-key': 'staging.key'
+ },
+ releases_bucket='s3://staging-releases',
+ git_repo='ssh://git@git.lix.systems/lix-project/lix-releng-staging',
+)
+
+
+@dataclasses.dataclass
+class S3Credentials:
+ name: str
+ id: str
+ secret_key: str