3 echo "*******************************************************************"
4 echo "* STARTING PUSH OF PACKAGES TO REPOS"
5 echo "* NOTHING THAT HAPPENS BELOW THIS POINT IS RELATED TO BUILD FAILURE"
6 echo "*******************************************************************"
8 [ "$MVN" ] || MVN="/opt/apache/maven/bin/mvn"
9 GROUP_ID="io.fd.${PROJECT}"
10 BASEURL="${NEXUSPROXY}/content/repositories/fd.io."
23 d_classifier="-Dclassifier=$7"
26 if [ ! -f "$push_file" ] ; then
27 echo "file for deployment does not exist: $push_file"
31 # Disable checks for doublequote to prevent glob / splitting
32 # shellcheck disable=SC2086
33 $MVN org.apache.maven.plugins:maven-deploy-plugin:deploy-file \
34 -Dfile=$push_file -DrepositoryId=$repoId \
35 -Durl=$url -DgroupId=$GROUP_ID \
36 -Dversion=$version -DartifactId=$artifactId \
37 -Dtype=$file_type $d_classifier\
38 -gs $GLOBAL_SETTINGS_FILE -s $SETTINGS_FILE
40 # make sure the script bombs if we fail an upload
41 if [ "$?" != '0' ]; then
42 echo "ERROR: There was an error with the upload"
50 repoId="${BASEREPOID}snapshot"
51 url="${BASEURL}snapshot"
54 # * jvpp-registry-16.09.jar
57 basefile=$(basename -s .jar "$jarfile")
58 artifactId=$(echo "$basefile" | rev | cut -d '-' -f 2- | rev)
59 version=$(echo "$basefile" | rev | cut -d '-' -f 1 | rev)
61 push_file "$jarfile" "$repoId" "$url" "${version}-SNAPSHOT" "$artifactId" jar
67 repoId="fd.io.${REPO_NAME}"
68 url="${BASEURL}${REPO_NAME}"
70 basefile=$(basename -s .deb "$debfile")
71 artifactId=$(echo "$basefile" | cut -f 1 -d '_')
72 version=$(echo "$basefile" | cut -f 2- -d '_')
76 push_file "$debfile" "$repoId" "$url" "$version" "$artifactId" "$file_type" "$classifier"
82 repoId="fd.io.${REPO_NAME}"
83 url="${BASEURL}${REPO_NAME}"
85 if grep -qE '\.s(rc\.)?rpm' <<<"$rpmfile"
87 rpmrelease=$(rpm -qp --queryformat="%{release}.src" "$rpmfile")
89 rpmrelease=$(rpm -qp --queryformat="%{release}.%{arch}" "$rpmfile")
91 artifactId=$(rpm -qp --queryformat="%{name}" "$rpmfile")
92 version=$(rpm -qp --queryformat="%{version}" "$rpmfile")
93 push_file "$rpmfile" "$repoId" "$url" "${version}-${rpmrelease}" "$artifactId" rpm