parent
beaf1377f9
commit
c3cbee968f
2 changed files with 41 additions and 3 deletions
|
@ -1,3 +1,22 @@
|
||||||
|
from os import path
|
||||||
|
|
||||||
|
BRANCH = [
|
||||||
|
'GITHUB_REF_NAME',
|
||||||
|
'CI_COMMIT_BRANCH',
|
||||||
|
]
|
||||||
|
NAME = [
|
||||||
|
'GITHUB_REPOSITORY',
|
||||||
|
'CI_PROJECT_PATH',
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
class Project:
|
class Project:
|
||||||
def __init__(self):
|
def __init__(self, environment):
|
||||||
pass
|
# branch
|
||||||
|
for variable in BRANCH:
|
||||||
|
if value := environment.get(variable, None):
|
||||||
|
self.branch = value
|
||||||
|
# name
|
||||||
|
for variable in NAME:
|
||||||
|
if value := environment.get(variable, None):
|
||||||
|
self.name = path.basename(value)
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
from os import path
|
||||||
|
|
||||||
|
GROUP_AND_NAME = [
|
||||||
|
'GITHUB_REPOSITORY',
|
||||||
|
'CI_PROJECT_PATH',
|
||||||
|
]
|
||||||
|
SERVER_URL = [
|
||||||
|
'GITHUB_SERVER_URL',
|
||||||
|
'CI_SERVER_URL',
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
class Projects:
|
class Projects:
|
||||||
def __init__(self, environment):
|
def __init__(self, environment):
|
||||||
self.env = 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)
|
||||||
|
|
Loading…
Reference in a new issue