- file_name = spec.input[u"zip-file-name"]
- new_name = join(
- spec.environment[u"paths"][u"DIR[WORKING,DATA]"],
- f"{job}{SEPARATOR}{build[u'build']}{SEPARATOR}{file_name}"
- )
- release = re.search(REGEX_RELEASE, job).group(2)
- for rls in (release, u"master"):
- nexus_file_name = \
- f"{job}{SEPARATOR}{build[u'build']}{SEPARATOR}{file_name}"
- try:
- rls = f"rls{int(rls)}"
- except ValueError:
- # It is master
- pass
- url = (
- f"{spec.environment[u'urls'][u'URL[NEXUS,DOC]']}/"
- f"{rls}/"
- f"{spec.environment[u'urls'][u'DIR[NEXUS,DOC]']}/"
- f"{nexus_file_name}"
- )
-
- logging.info(f"Downloading {url}")
-
- success, downloaded_name = _download_file(url, new_name, log)
- if success:
- break
-
- if not success:
-
- # Try to download .zip from jenkins.fd.io
-
- file_name = spec.input[u"zip-file-name"]
- download_path = spec.input[u"zip-download-path"]
- if job.startswith(u"csit-"):
- url = spec.environment[u"urls"][u"URL[JENKINS,CSIT]"]
- elif job.startswith(u"hc2vpp-"):
- url = spec.environment[u"urls"][u"URL[JENKINS,HC]"]
- else:
- raise PresentationError(f"No url defined for the job {job}.")
-
- full_name = download_path.format(
- job=job, build=build[u"build"], filename=file_name
- )
- url = u"{0}/{1}".format(url, full_name)
- new_name = join(
- spec.environment[u"paths"][u"DIR[WORKING,DATA]"],
- f"{job}{SEPARATOR}{build[u'build']}{SEPARATOR}{file_name}"
- )