- "{job}{sep}{build}{sep}{name}".
- format(job=job, sep=SEPARATOR, build=build["build"],
- name=file_name))
- # Download the file from the defined source (Jenkins, logs.fd.io):
- success = _download_file(url, new_name)
+ "{job}{sep}{build}{sep}{name}".format(
+ job=job, sep=SEPARATOR, build=build["build"],
+ name=file_name))
+
+ logging.info("Trying to download {0}".format(url))
+
+ arch = True if spec.configuration.get("archive-inputs", True) else False
+ success, downloaded_name = _download_file(url, new_name, log, arch=arch)
+
+ if not success:
+
+ # Try to download .gz from docs.fd.io
+
+ file_name = spec.input["file-name"]
+ url = "{0}/{1}".format(
+ spec.environment["urls"]["URL[NEXUS,DOC]"],
+ spec.input["download-path"].format(
+ job=job, build=build["build"], filename=file_name))
+ new_name = join(spec.environment["paths"]["DIR[WORKING,DATA]"],
+ "{job}{sep}{build}{sep}{name}".format(
+ job=job, sep=SEPARATOR, build=build["build"],
+ name=file_name))
+
+ logging.info("Downloading {0}".format(url))
+
+ if spec.configuration.get("archive-inputs", True):
+ arch = True
+ success, downloaded_name = _download_file(url, new_name, log, arch=arch)