Report only the meaningful details in the report file being archived
[releng/builder.git] / jjb / integration / include-raw-integration-compare-distributions.sh
1 #!/bin/bash
2
3 # Depends on variables created and published from the get-bundle-vars script
4
5 # Do not fail the build if there is trouble trying to collect distribution patch diffs
6 set +e
7
8 wget --progress=dot:mega $ACTUALBUNDLEURL
9 echo "Extracting the last distribution found on nexus..."
10 unzip -q $BUNDLE
11 mv $BUNDLEFOLDER /tmp/distro_old
12 rm $BUNDLE
13
14 echo "Extracting the distribution just created by this job..."
15 NEW_DISTRO=$(find $WORKSPACE -name distribution-karaf*.zip)
16 NEW_DISTRO_BASENAME=$(basename $NEW_DISTRO)
17 cp $NEW_DISTRO /tmp/
18 cd /tmp/
19 # get the name of the folder which will be extracted to
20 EXTRACTED_FOLDER=$(unzip $NEW_DISTRO_BASENAME | grep 'creating:' | grep -v '/.' | cut -d' ' -f5-)
21 mv $EXTRACTED_FOLDER distro_new
22
23 git clone https://git.opendaylight.org/gerrit/p/integration/test.git
24 cd test/tools/distchanges
25 mkdir -p $WORKSPACE/archives
26
27 # Full output of compare tool will be in temp file /tmp/dist_diff.txt
28 # The file/report to be archived will only list the distribution in the comparison and the patches that
29 # are different.
30 python distcompare.py -r ssh://jenkins-$SILO@git.opendaylight.org:29418 | tee /tmp/dist_diff.txt
31 echo -e "Patch differences listed are in comparison to:\n\t$ACTUALBUNDLEURL\n\n" > $WORKSPACE/archives/distribution_differences.txt
32 sed -ne '/Patch differences/,$ p' /tmp/dist_diff.txt >> $WORKSPACE/archives/distribution_differences.txt