diff options
Diffstat (limited to 'releng/environment.py')
-rw-r--r-- | releng/environment.py | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/releng/environment.py b/releng/environment.py index 58633d548..e8e7e771e 100644 --- a/releng/environment.py +++ b/releng/environment.py @@ -17,6 +17,21 @@ DEFAULT_STORE_URI_BITS = { @dataclasses.dataclass +class DockerTarget: + registry_path: str + + def resolve(self, version: str) -> str: + """Applies templates: + - version: the Lix version + """ + return self.registry_path.format(version=version) + + def registry_name(self) -> str: + [a, _, _] = self.registry_path.partition('/') + return a + + +@dataclasses.dataclass class RelengEnvironment: name: str @@ -26,22 +41,33 @@ class RelengEnvironment: docs_bucket: str git_repo: str + docker_targets: list[DockerTarget] + 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', docs_bucket='s3://staging-docs', cache_bucket='s3://staging-cache', - cache_store_overlay={ - 'secret-key': 'staging.key' - }, + cache_store_overlay={'secret-key': 'staging.key'}, releases_bucket='s3://staging-releases', git_repo='ssh://git@git.lix.systems/lix-project/lix-releng-staging', + docker_targets=[ + DockerTarget( + 'git.lix.systems/lix-project/lix-releng-staging:{version}'), + DockerTarget( + 'ghcr.io/lix-project/lix-releng-staging:{version}'), + ], ) +ENVIRONMENTS = { + 'staging': STAGING, +} + @dataclasses.dataclass class S3Credentials: |