3 # Determine the path to maven
4 if [ -z "${MAVEN_SELECTOR}" ]; then
5 echo "ERROR: No Maven install detected!"
9 MVN="${HOME}/tools/hudson.tasks.Maven_MavenInstallation/${MAVEN_SELECTOR}/bin/mvn"
10 GROUP_ID="io.fd.${PROJECT}"
11 BASEURL="${NEXUSPROXY}/content/repositories/fd.io."
24 if [ "$classifier" ]; then
25 d_classifier="-Dclassifier=$7"
28 # Disable checks for doublequote to prevent glob / splitting
29 # shellcheck disable=SC2086
30 $MVN org.apache.maven.plugins:maven-deploy-plugin:deploy-file \
31 -Dfile=$push_file -DrepositoryId=$repoId \
32 -Durl=$url -DgroupId=$GROUP_ID \
33 -Dversion=$version -DartifactId=$artifactId \
34 -Dtype=$file_type $d_classifier\
35 -gs $GLOBAL_SETTINGS_FILE -s $SETTINGS_FILE
37 # make sure the script bombs if we fail an upload
38 if [ "$?" != '0' ]; then
39 echo "ERROR: There was an error with the upload"
47 repoId="${BASEREPOID}snapshot"
48 url="${BASEURL}snapshot"
50 basefile=$(basename -s .jar "$jarfile")
51 artifactId=$(echo "$basefile" | cut -f 1 -d '-')
52 version=$(echo "$basefile" | cut -f 2 -d '-')
54 push_file "$jarfile" "$repoId" "$url" "${version}-SNAPSHOT" "$artifactId" jar
60 repoId="fd.io.${REPO_NAME}"
61 url="${BASEURL}${REPO_NAME}"
63 basefile=$(basename -s .deb "$debfile")
64 artifactId=$(echo "$basefile" | cut -f 1 -d '_')
65 version=$(echo "$basefile" | cut -f 2- -d '_')
67 push_file "$debfile" "$repoId" "$url" "$version" "$artifactId" deb
73 repoId="fd.io.${REPO_NAME}"
74 url="${BASEURL}${REPO_NAME}"
76 if grep -qE '\.s(rc\.)?rpm' <<<"$rpmfile"
78 rpmrelease=$(rpm -qp --queryformat="%{release}.src" "$rpmfile")
80 rpmrelease=$(rpm -qp --queryformat="%{release}.%{arch}" "$rpmfile")
82 artifactId=$(rpm -qp --queryformat="%{name}" "$rpmfile")
83 version=$(rpm -qp --queryformat="%{version}" "$rpmfile")
84 push_file "$rpmfile" "$repoId" "$url" "${version}-${rpmrelease}" "$artifactId" rpm
87 if [ "${OS}" == "ubuntu1404" ]; then
89 JARS=$(find . -type f -iname '*.jar')
90 DEBS=$(find . -type f -iname '*.deb')
100 elif [ "${OS}" == "ubuntu1604" ]; then
101 DEBS=$(find . -type f -iname '*.deb')
106 elif [ "${OS}" == "centos7" ]; then
108 RPMS=$(find . -type f -iname '*.rpm')
109 SRPMS=$(find . -type f -iname '*.srpm')
110 SRCRPMS=$(find . -type f -name '*.src.rpm')
111 for i in $RPMS $SRPMS $SRCRPMS
116 # vim: ts=4 sw=4 sts=4 et ft=sh :