config: load public cc-ci runtime environment
This commit is contained in:
@@ -40,19 +40,22 @@ from datetime import datetime, timezone
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
USED_RECIPES = os.path.join(HERE, "used-recipes.md")
|
||||
TESTENV = os.environ.get("CCCI_TESTENV", "/srv/cc-ci/.testenv")
|
||||
PUBLIC_ENV = "/srv/cc-ci/cc-ci/.env.public"
|
||||
NS = "recipe-maintainers"
|
||||
|
||||
|
||||
def _env() -> dict:
|
||||
e = {}
|
||||
try:
|
||||
for ln in open(TESTENV):
|
||||
for path in (PUBLIC_ENV, TESTENV):
|
||||
try:
|
||||
lines = open(path)
|
||||
except OSError:
|
||||
continue
|
||||
for ln in lines:
|
||||
ln = ln.strip()
|
||||
if "=" in ln and not ln.startswith("#"):
|
||||
k, v = ln.split("=", 1)
|
||||
e[k] = v.strip().strip('"').strip("'")
|
||||
except OSError:
|
||||
pass
|
||||
return e
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user