spcd/cd/projects.py
Marc Beninca c3cbee968f
Some checks failed
/ job (push) Failing after 8s
draft
2024-04-27 16:14:03 +02:00

22 lines
548 B
Python

from os import path
GROUP_AND_NAME = [
'GITHUB_REPOSITORY',
'CI_PROJECT_PATH',
]
SERVER_URL = [
'GITHUB_SERVER_URL',
'CI_SERVER_URL',
]
class Projects:
def __init__(self, environment):
# group, name
for variable in GROUP_AND_NAME:
if value := environment.get(variable, None):
self.group, self.name = path.split(value)
# url
for variable in SERVER_URL:
if value := environment.get(variable, None):
self.url = path.join(value, self.group)