diff --git a/tests/gitea/recipe_meta.py b/tests/gitea/recipe_meta.py index d7b9eb8..422972e 100644 --- a/tests/gitea/recipe_meta.py +++ b/tests/gitea/recipe_meta.py @@ -71,18 +71,9 @@ def UPGRADE_SECRET_PREP(ctx): import base64 import subprocess - env_path = _os.path.expanduser(f"~/.abra/servers/default/{ctx.domain}.env") - stack_name = None - try: - with open(env_path) as fh: - for line in fh: - if line.startswith("STACK_NAME="): - stack_name = line.split("=", 1)[1].strip().strip('"').strip("'") - except OSError: - pass - if not stack_name: - raise RuntimeError(f"UPGRADE_SECRET_PREP: STACK_NAME not found in {env_path}") - + # abra derives STACK_NAME from the domain by replacing dots with underscores + # (e.g. gite-e1cb78.ci.commoninternet.net → gite-e1cb78_ci_commoninternet_net). + stack_name = ctx.domain.replace(".", "_") docker_secret = f"{stack_name}_lfs_jwt_secret_v1" value = base64.urlsafe_b64encode(_os.urandom(32)).rstrip(b"=").decode()