Skip to content

Commit

Permalink
List the latest SNAPSHOT jar file in local maven repo
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Liu <timl@nvidia.com>
  • Loading branch information
NvTimLiu committed Nov 11, 2020
1 parent 48cb388 commit 05cd80c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jenkins/printJarVersion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ function print_ver(){

if [[ "$VERSION" == *"-SNAPSHOT" ]]; then
PREFIX=${VERSION%-SNAPSHOT}
TIMESTAMP=`grep -oP '(?<=timestamp>)[^<]+' < $REPO/maven-metadata-$SERVER_ID.xml`
BUILD_NUM=`grep -oP '(?<=buildNumber>)[^<]+' < $REPO/maven-metadata-$SERVER_ID.xml`
echo $TAG=$PREFIX-$TIMESTAMP-$BUILD_NUM$SUFFIX
# List the latest SNAPSHOT jar file in the maven repo
FILE_NAME=`ls -t $REPO/$PREFIX-[0-9]*$SUFFIX | head -1 | xargs basename`
echo $TAG=$FILE_NAME
else
echo $TAG=$VERSION$SUFFIX
fi
Expand Down

0 comments on commit 05cd80c

Please sign in to comment.