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="${BASEREPOID}dev"
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="${BASEREPOID}yum"
76 if grep -q srpm <<<"$rpmfile"
79 basefile=$(basename -s .srpm "$rpmfile")
82 basefile=$(basename -s .rpm "$rpmfile")
84 artifactId=$(echo "$basefile" | cut -f 1 -d '_')
85 version=$(echo "$basefile" | cut -f 2- -d '_')
86 push_file "$rpmfile" "$repoId" "$url" "$version" "$artifactId" "$rpmtype"
89 if [ "${OS}" == "ubuntu1404" ]; then
91 JARS=$(find . -type f -iname '*.jar')
92 DEBS=$(find . -type f -iname '*.deb')
102 elif [ "${OS}" == "centos7" ]; then
104 RPMS=$(find . -type f -iname '*.rpm')
105 SRPMS=$(find . -type f -iname '*.srpm')
106 for i in $RPMS $SRPMS
111 # vim: ts=4 sw=4 sts=4 et ft=sh :