4 BUNDLE_VERSION=$(xpath "${BUNDLE_POM}" '/project/version/text()' 2> /dev/null)
5 BUNDLEFOLDER="${KARAF_ARTIFACT}-${BUNDLE_VERSION}"
6 BUNDLE="${BUNDLEFOLDER}.zip"
7 BUNDLE_PATH="/tmp/r/org/opendaylight/integration/${KARAF_ARTIFACT}/${BUNDLE_VERSION}/${BUNDLE}"
9 LOG_FILE='integration-upload-distribution.log'
10 echo "Uploading distribution to Nexus..."
11 "$MVN" deploy:deploy-file \
12 --log-file ${LOG_FILE} \
13 --global-settings "$GLOBAL_SETTINGS_FILE" \
14 --settings "$SETTINGS_FILE" \
15 -Dfile="${BUNDLE_PATH}" \
16 -DrepositoryId=opendaylight-snapshot \
17 -Durl="$ODLNEXUSPROXY/content/repositories/opendaylight.snapshot/" \
18 -DgroupId="org.opendaylight.integration.${GERRIT_PROJECT//\//.}" \
19 -DartifactId=${KARAF_ARTIFACT} \
20 -Dversion="${BUNDLE_VERSION}" \
22 || true # Sandbox is not allowed to uplad to Nexus.
26 BUNDLE_URL=$(grep "Uploaded.*${KARAF_ARTIFACT}/${BUNDLE_VERSION}.*.zip" ${LOG_FILE} | awk '{print $5}') || true
27 echo "Bundle uploaded to ${BUNDLE_URL}"
29 # Re-inject the new BUNDLE_URL for downstream jobs to pull from Nexus
30 cat > "${WORKSPACE}/integration-upload-distribution.env" <<EOF
31 BUNDLE_URL=${BUNDLE_URL}
32 BUNDLE_VERSION=${BUNDLE_VERSION}
33 BUNDLEFOLDER=${BUNDLEFOLDER}
35 BUNDLE_PATH=${BUNDLE_PATH}