summaryrefslogtreecommitdiffstats
path: root/jjb/3rd_party_ci/download-netvirt-artifact.sh
diff options
context:
space:
mode:
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>2016-12-01 10:41:31 +0100
committerFatih Degirmenci <fatih.degirmenci@ericsson.com>2016-12-12 13:34:07 +0100
commit8578eae1f451aef3ce4f4f499f43ed924a2a0efa (patch)
tree1c8fe619274cb59afcf601bc7ea3b926be5a1695 /jjb/3rd_party_ci/download-netvirt-artifact.sh
parent9e13f849ce26b7b9c88e7d5696dfd58ab4436a61 (diff)
3rd party ci: Create jobs for ODL netvirt testing in OPNFV
This change creates basic job structure for ODL netvirt testing in OPNFV. The job should be triggered once the below job is completed https://jenkins.opendaylight.org/releng/job/netvirt-patch-test-current-carbon and fetch the artifact that is already built by the job. The build result codes OPNFV is interested in are SUCCESSFUL and UNSTABLE. Once the job gets triggered, the build URL will be fetched from ODL Gerrit using Gerrit REST API and the artifact will be downloaded from ODL Jenkins. The downloaded artifacts will then be installed on the Apex environment. There are 3 points that need to be highlighted. - The Apex environment will be created using the promoted snaphots/qcow2 images and already deployed VMs will be brought up. See below for the details. https://jira.opnfv.org/browse/APEX-360 - The hardcoded values in download-netvirt-artifact.sh are there to get the basics in place. (branch name, job name, etc.) Once things work as expected, they will be made dynamic. - A workaround using Gerrit REST API is put in place to get build number of the job netvirt-patch-test-current-carbon to download the artifact. The reason why we use Gerrit REST API is that the OPNFV Jenkins has an older version of Gerrit Trigger Plugin which lacks feature that injects review comments as environment variables. Upgrading Gerrit Trigger Plugin will not help either since OpenStack JJB does not support the new version of Gerrit Trigger Plugin and does not generate the new job XML. JIRA: RELENG-171 Change-Id: I7ff8c5809dcb2e8ffa5c7c5aeb9cdf70e4e7e2f4 Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
Diffstat (limited to 'jjb/3rd_party_ci/download-netvirt-artifact.sh')
-rwxr-xr-xjjb/3rd_party_ci/download-netvirt-artifact.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/jjb/3rd_party_ci/download-netvirt-artifact.sh b/jjb/3rd_party_ci/download-netvirt-artifact.sh
new file mode 100755
index 000000000..d0b9a05d7
--- /dev/null
+++ b/jjb/3rd_party_ci/download-netvirt-artifact.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+echo "Attempting to fetch the artifact location from ODL Jenkins"
+CHANGE_DETAILS_URL="https://git.opendaylight.org/gerrit/changes/netvirt~master~$GERRIT_CHANGE_ID/detail"
+# due to limitation with the Jenkins Gerrit Trigger, we need to use Gerrit REST API to get the change details
+ODL_JOB_URL=$(curl -s $CHANGE_DETAILS_URL | grep netvirt-patch-test-current-carbon | tail -1 | \
+ sed 's/\\n//g' | awk '{print $6}')
+NETVIRT_ARTIFACT_URL="${ODL_JOB_URL}org.opendaylight.integration\$distribution-karaf/artifact/org.opendaylight.integration/distribution-karaf/0.6.0-SNAPSHOT/distribution-karaf-0.6.0-SNAPSHOT.tar.gz"
+echo -e "URL to artifact is\n\t$NETVIRT_ARTIFACT_URL"
+echo "Downloading the artifact. This could take time..."
+curl -s -o $NETVIRT_ARTIFACT $NETVIRT_ARTIFACT_URL
+echo "Download complete"
+ls -al $NETVIRT_ARTIFACT