File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,30 @@ update_snapshot_link() {
1616 local COMPONENT=$1
1717 local ARTIFACT_ID=$2
1818 local CLASSIFIER=$3
19+ local MAX_RETRIES=3
20+ local RETRY_DELAY=5
21+
22+ echo " Fetching $COMPONENT metadata"
23+ for (( i= 1 ; i<= MAX_RETRIES; i++ )) ; do
24+ SNAPSHOT_VERSION=$( curl --connect-timeout 10 --max-time 30 --silent -fSL $MAVEN_REPO /$GROUP_ID /$ARTIFACT_ID /$DEBEZIUM_VERSION /maven-metadata.xml | awk -F' <[^>]+>' ' /<extension>tar.gz<\/extension>/ {getline; print $2; exit}' )
25+
26+ if [[ -n " $SNAPSHOT_VERSION " ]]; then
27+ break
28+ fi
29+
30+ echo " Attempt $i /$MAX_RETRIES failed for $COMPONENT , retrying"
31+ sleep " $RETRY_DELAY "
32+ RETRY_DELAY=$(( RETRY_DELAY * 2 ))
33+ done
34+
35+ if [[ -z " $SNAPSHOT_VERSION " ]]; then
36+ echo " ERROR: Failed to resolve snapshot for $COMPONENT after $MAX_RETRIES retries"
37+ return 1
38+ fi
1939
20- SNAPSHOT_VERSION=$( curl --silent -fSL $MAVEN_REPO /$GROUP_ID /$ARTIFACT_ID /$DEBEZIUM_VERSION /maven-metadata.xml | awk -F' <[^>]+>' ' /<extension>tar.gz<\/extension>/ {getline; print $2; exit}' )
2140 SNAPSHOT_LINK=" $MAVEN_REPO /$GROUP_ID /$ARTIFACT_ID /$DEBEZIUM_VERSION /$ARTIFACT_ID -${SNAPSHOT_VERSION}${CLASSIFIER} .tar.gz"
2241 sed -i " s#link-$COMPONENT -snapshot:.*#link-$COMPONENT -snapshot: \'$SNAPSHOT_LINK \'#" $ANTORA_FILE
42+ echo " Updated $COMPONENT as $SNAPSHOT_LINK "
2343}
2444
2545for CONNECTOR in " ${CONNECTORS[@]} " ; do
You can’t perform that action at this time.
0 commit comments