From: Marek Gradzki Date: Wed, 17 Aug 2016 05:21:15 +0000 (+0200) Subject: Fix artifactId and version of deployed jars X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=48ad761f48fb2d4e676bf1aa6779a9e6ee30b44e;p=ci-management.git Fix artifactId and version of deployed jars Jar name can consist of more than two groups separated by a hyphen. Last group should be treated as a version, rest as artifact name. Examples: jvpp-registry-16.09.jar jvpp-16.09.jar Add example jar names to source to ease comprehension Change-Id: Ica0b490c4213224abc70774aa41c60e62f0360f0 Signed-off-by: Marek Gradzki Signed-off-by: C.J. Collier --- diff --git a/jjb/scripts/maven_push_functions.sh b/jjb/scripts/maven_push_functions.sh index 45428e292..6849f314a 100644 --- a/jjb/scripts/maven_push_functions.sh +++ b/jjb/scripts/maven_push_functions.sh @@ -50,9 +50,13 @@ function push_jar () repoId="${BASEREPOID}snapshot" url="${BASEURL}snapshot" + # examples: + # * jvpp-registry-16.09.jar + # * jvpp-16.09.jar + basefile=$(basename -s .jar "$jarfile") - artifactId=$(echo "$basefile" | cut -f 1 -d '-') - version=$(echo "$basefile" | cut -f 2 -d '-') + artifactId=$(echo "$basefile" | rev | cut -d '-' -f 2- | rev) + version=$(echo "$basefile" | rev | cut -d '-' -f 1 | rev) push_file "$jarfile" "$repoId" "$url" "${version}-SNAPSHOT" "$artifactId" jar } diff --git a/jjb/vpp/include-raw-vpp-maven-push.sh b/jjb/vpp/include-raw-vpp-maven-push.sh index 0e9c33420..c26e5d37a 100644 --- a/jjb/vpp/include-raw-vpp-maven-push.sh +++ b/jjb/vpp/include-raw-vpp-maven-push.sh @@ -47,8 +47,8 @@ function push_jar () url="${BASEURL}snapshot" basefile=$(basename -s .jar "$jarfile") - artifactId=$(echo "$basefile" | cut -f 1 -d '-') - version=$(echo "$basefile" | cut -f 2 -d '-') + artifactId=$(echo "$basefile" | rev | cut -d '-' -f 2- | rev) + version=$(echo "$basefile" | rev | cut -d '-' -f 1 | rev) push_file "$jarfile" "$repoId" "$url" "${version}-SNAPSHOT" "$artifactId" jar }