File tree Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -45,20 +45,25 @@ if [[ $RELEASE_TYPE = "RELEASE" ]]; then
45
45
POST " ${ARTIFACTORY_SERVER} /api/build/distribute/${buildName} /${buildNumber} " > /dev/null || { echo " Failed to distribute" >&2 ; exit 1; }
46
46
47
47
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
57
62
fi
58
- COUNTER =$(( COUNTER + 1 ))
63
+ retry_counter =$(( retry_counter + 1 ))
59
64
sleep $WAIT_TIME
60
65
done
61
- if [[ $ARTIFACTS_PUBLISHED = " false" ]]; then
66
+ if [[ $artifacts_published = " false" ]]; then
62
67
echo " Failed to publish"
63
68
exit 1
64
69
else
You can’t perform that action at this time.
0 commit comments