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 d_classifier="-Dclassifier=$7"
32 if [ ! -f "$push_file" ] ; then
33 echo "file for deployment does not exist: $push_file"
37 # Disable checks for doublequote to prevent glob / splitting
38 # shellcheck disable=SC2086
39 $MVN org.apache.maven.plugins:maven-deploy-plugin:deploy-file \
40 -Dfile=$push_file -DrepositoryId=$repoId \
41 -Durl=$url -DgroupId=$GROUP_ID \
42 -Dversion=$version -DartifactId=$artifactId \
43 -Dtype=$file_type $d_classifier\
44 -gs $GLOBAL_SETTINGS_FILE -s $SETTINGS_FILE
46 # make sure the script bombs if we fail an upload
47 if [ "$?" != '0' ]; then
48 echo "ERROR: There was an error with the upload"
56 repoId="${BASEREPOID}snapshot"
57 url="${BASEURL}snapshot"
59 basefile=$(basename -s .jar "$jarfile")
60 artifactId=$(echo "$basefile" | cut -f 1 -d '-')
61 version=$(echo "$basefile" | cut -f 2 -d '-')
63 push_file "$jarfile" "$repoId" "$url" "${version}-SNAPSHOT" "$artifactId" jar
69 repoId="fd.io.${REPO_NAME}"
70 url="${BASEURL}${REPO_NAME}"
72 basefile=$(basename -s .deb "$debfile")
73 artifactId=$(echo "$basefile" | cut -f 1 -d '_')
74 version=$(echo "$basefile" | cut -f 2- -d '_')
76 push_file "$debfile" "$repoId" "$url" "$version" "$artifactId" deb
82 repoId="fd.io.${REPO_NAME}"
83 url="${BASEURL}${REPO_NAME}"
85 if grep -qE '\.s(rc\.)?rpm' <<<"$rpmfile"
87 rpmrelease=$(rpm -qp --queryformat="%{release}.src" "$rpmfile")
89 rpmrelease=$(rpm -qp --queryformat="%{release}.%{arch}" "$rpmfile")
91 artifactId=$(rpm -qp --queryformat="%{name}" "$rpmfile")
92 version=$(rpm -qp --queryformat="%{version}" "$rpmfile")
93 push_file "$rpmfile" "$repoId" "$url" "${version}-${rpmrelease}" "$artifactId" rpm