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="/opt/apache/maven/bin/mvn"
9 GROUP_ID="io.fd.${PROJECT}"
10 BASEURL="${NEXUSPROXY}/content/repositories/fd.io."
23 if [ "$classifier" ]; then
24 d_classifier="-Dclassifier=$7"
27 # Disable checks for doublequote to prevent glob / splitting
28 # shellcheck disable=SC2086
29 $MVN org.apache.maven.plugins:maven-deploy-plugin:deploy-file \
30 -Dfile=$push_file -DrepositoryId=$repoId \
31 -Durl=$url -DgroupId=$GROUP_ID \
32 -Dversion=$version -DartifactId=$artifactId \
33 -Dtype=$file_type $d_classifier\
34 -gs $GLOBAL_SETTINGS_FILE -s $SETTINGS_FILE
36 # make sure the script bombs if we fail an upload
37 if [ "$?" != '0' ]; then
38 echo "ERROR: There was an error with the upload"
46 repoId="${BASEREPOID}snapshot"
47 url="${BASEURL}snapshot"
49 basefile=$(basename -s .jar "$jarfile")
50 artifactId=$(echo "$basefile" | rev | cut -d '-' -f 2- | rev)
51 version=$(echo "$basefile" | rev | cut -d '-' -f 1 | rev)
53 push_file "$jarfile" "$repoId" "$url" "${version}-SNAPSHOT" "$artifactId" jar
59 repoId="fd.io.${REPO_NAME}"
60 url="${BASEURL}${REPO_NAME}"
62 basefile=$(basename -s .deb "$debfile")
63 artifactId=$(echo "$basefile" | cut -f 1 -d '_')
64 version=$(echo "$basefile" | cut -f 2- -d '_')
66 push_file "$debfile" "$repoId" "$url" "$version" "$artifactId" deb
72 repoId="fd.io.${REPO_NAME}"
73 url="${BASEURL}${REPO_NAME}"
75 if grep -qE '\.s(rc\.)?rpm' <<<"$rpmfile"
77 rpmrelease=$(rpm -qp --queryformat="%{release}.src" "$rpmfile")
79 rpmrelease=$(rpm -qp --queryformat="%{release}.%{arch}" "$rpmfile")
81 artifactId=$(rpm -qp --queryformat="%{name}" "$rpmfile")
82 version=$(rpm -qp --queryformat="%{version}" "$rpmfile")
83 push_file "$rpmfile" "$repoId" "$url" "${version}-${rpmrelease}" "$artifactId" rpm
86 if [ "${OS}" == "ubuntu1404" ]; then
88 JARS=$(find . -type f -iname '*.jar')
89 DEBS=$(find . -type f -iname '*.deb')
99 elif [ "${OS}" == "ubuntu1604" ]; then
100 DEBS=$(find . -type f -iname '*.deb')
105 elif [ "${OS}" == "centos7" ]; then
107 RPMS=$(find . -type f -iname '*.rpm')
108 SRPMS=$(find . -type f -iname '*.srpm')
109 SRCRPMS=$(find . -type f -name '*.src.rpm')
110 for i in $RPMS $SRPMS $SRCRPMS
115 # vim: ts=4 sw=4 sts=4 et ft=sh :