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."
15 JARS=$(find . -type f -iname '*.jar')
16 DEBS=$(find . -type f -iname '*.deb')
28 if [ "$classifier" ]; then
29 d_classifier="-Dclassifier=$7"
32 # Disable checks for doublequote to prevent glob / splitting
33 # shellcheck disable=SC2086
34 $MVN org.apache.maven.plugins:maven-deploy-plugin:deploy-file \
35 -Dfile=$push_file -DrepositoryId=$repoId \
36 -Durl=$url -DgroupId=$GROUP_ID \
37 -Dversion=$version -DartifactId=$artifactId \
38 -Dtype=$file_type $d_classifier\
39 -gs $GLOBAL_SETTINGS_FILE -s $SETTINGS_FILE
41 # make sure the script bombs if we fail an upload
42 if [ "$?" != '0' ]; then
43 echo "ERROR: There was an error with the upload"
51 repoId="${BASEREPOID}snapshot"
52 url="${BASEURL}snapshot"
54 basefile=$(basename -s .jar "$jarfile")
55 artifactId=$(echo "$basefile" | cut -f 1 -d '-')
56 version=$(echo "$basefile" | cut -f 2 -d '-')
58 push_file "$jarfile" "$repoId" "$url" "${version}-SNAPSHOT" "$artifactId" jar
64 repoId="${BASEREPOID}dev"
67 basefile=$(basename -s .deb "$debfile")
68 artifactId=$(echo "$basefile" | cut -f 1 -d '_')
69 version=$(echo "$basefile" | cut -f 2- -d '_')
71 push_file "$debfile" "$repoId" "$url" "$version" "$artifactId" deb
73 if [ ${OS} == "ubuntu1404" ]; then
84 # vim: ts=4 sw=4 sts=4 et ft=sh :