summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Grimberg <agrimberg@linuxfoundation.org>2016-04-13 10:38:00 -0700
committerAndrew Grimberg <agrimberg@linuxfoundation.org>2016-04-13 10:38:00 -0700
commit38077b985a796ecddee4d904e6c18b26d67ee5f4 (patch)
tree7d28f3e51cbc93699ff3fee7eea8a97ac7f51644
parented0ac9b00c0582482e6d1b22f68c7887cd401b6d (diff)
Query RPM files directly using rpm for upload info
Instead of trying to figure out all the maven fields based upon the filename with possible failures that this can cause, instead, use the rpm command itself to query the built artifacts for the needed information. Also, .src.rpm should be the canonical name for source RPM files. Make sure that .srpm and .src.rpm are handled properly and they normalize to .src.rpm in nexus. Change-Id: I6b35c15e8e6b189a2144fe3cfb991e467933ad46 Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
-rw-r--r--jjb/vpp/include-raw-vpp-maven-push.sh17
1 files changed, 8 insertions, 9 deletions
diff --git a/jjb/vpp/include-raw-vpp-maven-push.sh b/jjb/vpp/include-raw-vpp-maven-push.sh
index dc75e907b..a8b03f6e9 100644
--- a/jjb/vpp/include-raw-vpp-maven-push.sh
+++ b/jjb/vpp/include-raw-vpp-maven-push.sh
@@ -73,17 +73,15 @@ function push_rpm ()
repoId="${BASEREPOID}yum"
url="${BASEURL}yum"
- if grep -q srpm <<<"$rpmfile"
+ if grep -qE '\.s(rc\.)?rpm' <<<"$rpmfile"
then
- rpmtype=srpm
- basefile=$(basename -s .srpm "$rpmfile")
+ rpmrelease=$(rpm -qp --queryformat="%{release}.src" "$rpmfile")
else
- rpmtype=rpm
- basefile=$(basename -s .rpm "$rpmfile")
+ rpmrelease=$(rpm -qp --queryformat="%{release}.%{arch}" "$rpmfile")
fi
- artifactId=$(echo "$basefile" | cut -f 1 -d '_')
- version=$(echo "$basefile" | cut -f 2- -d '_')
- push_file "$rpmfile" "$repoId" "$url" "$version" "$artifactId" "$rpmtype"
+ artifactId=$(rpm -qp --queryformat="%{name}" "$rpmfile")
+ version=$(rpm -qp --queryformat="%{version}" "$rpmfile")
+ push_file "$rpmfile" "$repoId" "$url" "${version}-${rpmrelease}" "$artifactId" rpm
}
if [ "${OS}" == "ubuntu1404" ]; then
@@ -103,7 +101,8 @@ elif [ "${OS}" == "centos7" ]; then
# Find the files
RPMS=$(find . -type f -iname '*.rpm')
SRPMS=$(find . -type f -iname '*.srpm')
- for i in $RPMS $SRPMS
+ SRCRPMS=$(find . -type f -name '*.src.rpm')
+ for i in $RPMS $SRPMS $SRCRPMS
do
push_rpm "$i"
done