From b19ea0a007762f19ba007178c1760a30a6508e25 Mon Sep 17 00:00:00 2001 From: Vratko Polak Date: Tue, 9 Feb 2016 13:14:51 +0100 Subject: [PATCH] Use fallback URL for deploying tools for custom-built .zip NexusKeywords.Deploy_Artifact was assuming that ${BUNDLE_URL} points to a full Nexus installation. But if the bundle under test comes from another source (most notably patch test job on Jenkins, either RelEng or Sandbox) there are no test tools on similar URLs. In that case, fall back to default ODL Nexus (snapshot repository). Change-Id: Icdd09da8ca219d26b42ca60e6aee0520220e9c31 Signed-off-by: Vratko Polak --- csit/libraries/NexusKeywords.robot | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/csit/libraries/NexusKeywords.robot b/csit/libraries/NexusKeywords.robot index 145bb66afe..90178aa331 100644 --- a/csit/libraries/NexusKeywords.robot +++ b/csit/libraries/NexusKeywords.robot @@ -16,6 +16,9 @@ Library SSHLibrary Library String Resource SSHKeywords.robot +*** Variables *** +${NEXUS_FALLBACK_URL} http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot + *** Keywords *** Initialize_Artifact_Deployment_And_Usage [Arguments] ${tools_system_connect}=True @@ -60,13 +63,16 @@ NexusKeywords__Detect_Version_To_Pull [Return] ${version} ${location} Deploy_Artifact - [Arguments] ${component} ${artifact} ${name_prefix} ${name_suffix}=-executable.jar + [Arguments] ${component} ${artifact} ${name_prefix} ${name_suffix}=-executable.jar ${fallback_url}=${NEXUS_FALLBACK_URL} [Documentation] Deploy the specified artifact from Nexus to the cwd of the machine to which the active SSHLibrary connection points. ... Must have ${BUNDLE_URL} variable set to the URL from which the ... tested ODL distribution was downloaded and this place must be ... inside a repository created by a standard distribution - ... construction job. + ... construction job. If this is detected to ne be the case, fallback URL is used. ${urlbase}= String.Fetch_From_Left ${BUNDLE_URL} /org/opendaylight + # If the BUNDLE_URL points somewhere else (perhaps *patch-test* job in Jenkins), + # ${urlbase} is the whole ${BUNDLE_URL}, in which case we use the ${fallback_url} + ${urlbase}= BuiltIn.Set_Variable_If '${urlbase}' != '${BUNDLE_URL}' ${urlbase} ${fallback_url} ${version} ${location}= NexusKeywords__Detect_Version_To_Pull ${component} # TODO: Use RequestsLibrary and String instead of curl and bash utilities? ${url}= BuiltIn.Set_Variable ${urlbase}/${location}/${artifact}/${version} -- 2.36.6