Skip to content
Snippets Groups Projects
Commit b62c6b1e authored by Lorenzo Pagliai's avatar Lorenzo Pagliai
Browse files

[DEPLOY-CI] Fix on projects to be CI-integrated

In the previous implementation the deploy-ci job was looking only for
projects with the INTEGRATION project variable explicitly referring to
the manifest repository. With this fix, the script will allow searching
also forprojects with the reference to the meta-layer inside the
INTEGRATION variable, thus allowing to integrate CI also for 'bsp' group
projects.
parent 1842df03
No related branches found
No related tags found
No related merge requests found
......@@ -21,8 +21,14 @@ def get_integration_sources(manifest_project: str, manifest_branch: str, group:
manifest_project, manifest_branch, subgroup
)
# Regex to check INTEGRATION variable against
regex = f":{manifest_project}:{manifest_branch}$"
# Regex to check INTEGRATION variable against (include also layers integration)
architecture = ["imx", "rk"]
regex = [f":{manifest_project}:{manifest_branch}$"]
manifest_subgroup = '/'.join(manifest_project.split('/')[:-1])
for arch in architecture:
regex.append(f"{manifest_subgroup}/meta-seco-{arch}:{manifest_branch}$")
# Include minimal-meta-seco for testing purposes
regex.append(f"{manifest_subgroup}/minimal-meta-seco:{manifest_branch}$")
for project in group.projects.list():
try:
......@@ -30,14 +36,15 @@ def get_integration_sources(manifest_project: str, manifest_branch: str, group:
if not project.archived and project.jobs_enabled:
integrations = project.variables.get("INTEGRATION").value
for integration in integrations.splitlines():
if re.search(regex, integration):
source_branch = integration.split(":")[0]
integration_sources.append(
{
"project": project.path_with_namespace,
"branch": source_branch,
}
)
for reg in regex:
if re.search(reg, integration):
source_branch = integration.split(":")[0]
integration_sources.append(
{
"project": project.path_with_namespace,
"branch": source_branch,
}
)
except GitlabGetError as e:
if e.response_code == 404: # not found
pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment