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 # Determine the path to maven
9 if [ -z "${MAVEN_SELECTOR}" ]; then
10 echo "ERROR: No Maven install detected!"
14 MVN="${HOME}/tools/hudson.tasks.Maven_MavenInstallation/${MAVEN_SELECTOR}/bin/mvn"
15 GROUP_ID="io.fd.${PROJECT}"
16 BASEURL="${NEXUSPROXY}/content/repositories/fd.io."
29 if [ "$classifier" ]; then
30 d_classifier="-Dclassifier=$7"
33 # Disable checks for doublequote to prevent glob / splitting
34 # shellcheck disable=SC2086
35 $MVN org.apache.maven.plugins:maven-deploy-plugin:deploy-file \
36 -Dfile=$push_file -DrepositoryId=$repoId \
37 -Durl=$url -DgroupId=$GROUP_ID \
38 -Dversion=$version -DartifactId=$artifactId \
39 -Dtype=$file_type $d_classifier\
40 -gs $GLOBAL_SETTINGS_FILE -s $SETTINGS_FILE
42 # make sure the script bombs if we fail an upload
43 if [ "$?" != '0' ]; then
44 echo "ERROR: There was an error with the upload"
52 repoId="${BASEREPOID}snapshot"
53 url="${BASEURL}snapshot"
55 basefile=$(basename -s .jar "$jarfile")
56 artifactId=$(echo "$basefile" | cut -f 1 -d '-')
57 version=$(echo "$basefile" | cut -f 2 -d '-')
59 push_file "$jarfile" "$repoId" "$url" "${version}-SNAPSHOT" "$artifactId" jar
65 repoId="fd.io.${REPO_NAME}"
66 url="${BASEURL}${REPO_NAME}"
68 basefile=$(basename -s .deb "$debfile")
69 artifactId=$(echo "$basefile" | cut -f 1 -d '_')
70 version=$(echo "$basefile" | cut -f 2- -d '_')
72 push_file "$debfile" "$repoId" "$url" "$version" "$artifactId" deb
78 repoId="fd.io.${REPO_NAME}"
79 url="${BASEURL}${REPO_NAME}"
81 if grep -qE '\.s(rc\.)?rpm' <<<"$rpmfile"
83 rpmrelease=$(rpm -qp --queryformat="%{release}.src" "$rpmfile")
85 rpmrelease=$(rpm -qp --queryformat="%{release}.%{arch}" "$rpmfile")
87 artifactId=$(rpm -qp --queryformat="%{name}" "$rpmfile")
88 version=$(rpm -qp --queryformat="%{version}" "$rpmfile")
89 push_file "$rpmfile" "$repoId" "$url" "${version}-${rpmrelease}" "$artifactId" rpm
92 if [ "${OS}" == "ubuntu1404" ]; then
94 JARS=$(find . -type f -iname '*.jar')
95 DEBS=$(find . -type f -iname '*.deb')
105 elif [ "${OS}" == "ubuntu1604" ]; then
106 DEBS=$(find . -type f -iname '*.deb')
111 elif [ "${OS}" == "centos7" ]; then
113 RPMS=$(find . -type f -iname '*.rpm')
114 SRPMS=$(find . -type f -iname '*.srpm')
115 SRCRPMS=$(find . -type f -name '*.src.rpm')
116 for i in $RPMS $SRPMS $SRCRPMS
121 # vim: ts=4 sw=4 sts=4 et ft=sh :