-if [ "$GERRIT_BRANCH" == "master" ]; then
- RTD_BUILD_VERSION=latest
-else
- RTD_BUILD_VERSION="${GERRIT_BRANCH/\//-}"
-fi
-
-CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
- -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
- -v x:username -o ":" -v x:password \
- "$SETTINGS_FILE")
+# Ensure RTD_BUILD_URL retains the trailing slash as it is needed for the API
+last_char=${RTD_BUILD_URL:length-1:1}
+[[ $last_char != "/" ]] && RTD_BUILD_URL="$RTD_BUILD_URL/"; :