Skip to content

Commit

Permalink
downloader: change way how to identify if pipeline uses new jenkins c…
Browse files Browse the repository at this point in the history
…i flow directory structure

Signed-off-by: kimpaller <[email protected]>
  • Loading branch information
kimpaller committed Nov 26, 2024
1 parent 3899177 commit 4b847d7
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions nebula/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,11 @@ def _get_file(
branch,
addl=None,
url_template=None,
new_flow=False
):
if source == "artifactory":
self._get_artifactory_file(
filename, design_source_root, source_root, branch, addl, url_template
filename, design_source_root, source_root, branch, addl, url_template, new_flow
)
elif source == "local_fs":
self._get_local_file(filename, design_source_root)
Expand All @@ -423,7 +424,7 @@ def _get_local_file(self, filename, source_root):
else:
raise Exception("File not found: " + src)

def _get_artifactory_file(self, filename, folder, ip, branch, addl, url_template):
def _get_artifactory_file(self, filename, folder, ip, branch, addl, url_template, new_flow):
dest = "outs"
if not os.path.isdir(dest):
os.mkdir(dest)
Expand All @@ -434,16 +435,6 @@ def _get_artifactory_file(self, filename, folder, ip, branch, addl, url_template
"No server IP or domain name specified. Must be defined in yaml or provided as input"
)

new_flow = False
for pipeline in [
"HDL_PRs",
"Linux_PRs",
"HDL_latest_commit",
"Linux_latest_commit",
]:
if bool(re.search(pipeline, url_template)):
new_flow = True

if new_flow:
url = url_template.format(folder, filename)
else:
Expand Down Expand Up @@ -482,19 +473,21 @@ def _get_files_boot_partition(
dt,
url_template=None,
):
new_flow = False
if source == "artifactory":
if url_template:
url_template = (
sanitize_artifactory_url(url_template) + "/boot_partition/{}/{}"
)
new_flow = True
else:
url_template = "https://{}/artifactory/sdg-generic-development/boot_partition/{}/{}/{}"

log.info("Getting standard boot files")
# Get kernel
log.info("Getting " + kernel)
self._get_file(
kernel, source, kernel_root, source_root, branch, url_template=url_template
kernel, source, kernel_root, source_root, branch, url_template=url_template, new_flow
)

if boot_subfolder is not None:
Expand Down

0 comments on commit 4b847d7

Please sign in to comment.