X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=jjb%2Fscripts%2Fmaven_push_functions.sh;h=d26b71422b3b34fa65b47eaab90d8d3c7a46abaf;hb=826f1ce77597f81375659725007e7aeb8cd79cf9;hp=22a22cbf8cf28d310a8379e36a1dcaf31f3815c0;hpb=a5283256c82b4e8c32e257e9572631116952431a;p=ci-management.git diff --git a/jjb/scripts/maven_push_functions.sh b/jjb/scripts/maven_push_functions.sh index 22a22cbf8..d26b71422 100644 --- a/jjb/scripts/maven_push_functions.sh +++ b/jjb/scripts/maven_push_functions.sh @@ -1,11 +1,27 @@ #!/bin/bash + +# Copyright (c) 2020 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +echo "---> jjb/scripts/maven_push_functions.sh" + set -xe -o pipefail echo "*******************************************************************" echo "* STARTING PUSH OF PACKAGES TO REPOS" echo "* NOTHING THAT HAPPENS BELOW THIS POINT IS RELATED TO BUILD FAILURE" echo "*******************************************************************" -MVN="/opt/apache/maven/bin/mvn" +[ "$MVN" ] || MVN="/opt/apache/maven/bin/mvn" GROUP_ID="io.fd.${PROJECT}" BASEURL="${NEXUSPROXY}/content/repositories/fd.io." BASEREPOID='fdio-' @@ -30,7 +46,7 @@ function push_file () # Disable checks for doublequote to prevent glob / splitting # shellcheck disable=SC2086 - $MVN org.apache.maven.plugins:maven-deploy-plugin:deploy-file \ + $MVN -B org.apache.maven.plugins:maven-deploy-plugin:deploy-file \ -Dfile=$push_file -DrepositoryId=$repoId \ -Durl=$url -DgroupId=$GROUP_ID \ -Dversion=$version -DartifactId=$artifactId \ @@ -70,8 +86,10 @@ function push_deb () basefile=$(basename -s .deb "$debfile") artifactId=$(echo "$basefile" | cut -f 1 -d '_') version=$(echo "$basefile" | cut -f 2- -d '_') + file_type=deb + classifier=deb - push_file "$debfile" "$repoId" "$url" "$version" "$artifactId" deb deb + push_file "$debfile" "$repoId" "$url" "$version" "$artifactId" "$file_type" "$classifier" } function push_rpm ()