#!/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-'
# 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 \
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
+ push_file "$debfile" "$repoId" "$url" "$version" "$artifactId" "$file_type" "$classifier"
}
function push_rpm ()