From befb5eb653b3c5c2c790622beca9261d0f0bcc2b Mon Sep 17 00:00:00 2001 From: bom Date: Fri, 17 Mar 2023 11:32:01 +0100 Subject: [PATCH] Add EnvironmentApi --- .../ddadevops/release_mixin/infrastructure_api.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/python/ddadevops/release_mixin/infrastructure_api.py b/src/main/python/ddadevops/release_mixin/infrastructure_api.py index ba6da17..70e8678 100644 --- a/src/main/python/ddadevops/release_mixin/infrastructure_api.py +++ b/src/main/python/ddadevops/release_mixin/infrastructure_api.py @@ -3,7 +3,7 @@ import re import subprocess as sub from abc import ABC, abstractmethod from pathlib import Path - +from os import environ class FileHandler(ABC): @@ -235,3 +235,14 @@ class GitApi(): def checkout(self, branch: str): self.system_api.run_checked('git', 'checkout', branch) return self.system_api.stdout + +class EnvironmentApi(): + + def __init__(self): + self.environ = environ + + def get(self, key): + return self.environ[key] + + def set(self, key, value): + self.environ[key] = value \ No newline at end of file