Skip to content

Commit ec094cd

Browse files
committed
Increase timeout for promote script
Increase the timeout used when checking if artifacts have landed in Bintray from 20m to 40m. Also added some additional protection against the curl command failing. Closes gh-16443
1 parent f12ab1f commit ec094cd

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

ci/scripts/promote.sh

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,25 @@ if [[ $RELEASE_TYPE = "RELEASE" ]]; then
4545
POST "${ARTIFACTORY_SERVER}/api/build/distribute/${buildName}/${buildNumber}" > /dev/null || { echo "Failed to distribute" >&2; exit 1; }
4646

4747
echo "Waiting for artifacts to be published"
48-
ARTIFACTS_PUBLISHED=false
49-
WAIT_TIME=10
50-
COUNTER=0
51-
while [ $ARTIFACTS_PUBLISHED == "false" ] && [ $COUNTER -lt 120 ]; do
52-
result=$( curl -s https://api.bintray.com/packages/"${BINTRAY_SUBJECT}"/"${BINTRAY_REPO}"/"${groupId}" )
53-
versions=$( echo "$result" | jq -r '.versions' )
54-
exists=$( echo "$versions" | grep "$version" -o || true )
55-
if [ "$exists" = "$version" ]; then
56-
ARTIFACTS_PUBLISHED=true
48+
49+
WAIT_TIME=20
50+
WAIT_ATTEMPTS=120
51+
52+
artifacts_published=false
53+
retry_counter=0
54+
while [ $artifacts_published == "false" ] && [ $retry_counter -lt WAIT_ATTEMPTS ]; do
55+
result=$( curl -s -f -u ${BINTRAY_USERNAME}:${BINTRAY_API_KEY} https://api.bintray.com/packages/"${BINTRAY_SUBJECT}"/"${BINTRAY_REPO}"/"${groupId}" )
56+
if [ $? -eq 0 ]; then
57+
versions=$( echo "$result" | jq -r '.versions' )
58+
exists=$( echo "$versions" | grep "$version" -o || true )
59+
if [ "$exists" = "$version" ]; then
60+
artifacts_published=true
61+
fi
5762
fi
58-
COUNTER=$(( COUNTER + 1 ))
63+
retry_counter=$(( retry_counter + 1 ))
5964
sleep $WAIT_TIME
6065
done
61-
if [[ $ARTIFACTS_PUBLISHED = "false" ]]; then
66+
if [[ $artifacts_published = "false" ]]; then
6267
echo "Failed to publish"
6368
exit 1
6469
else

0 commit comments

Comments
 (0)