From 216922e69a7196336bcb791483ac3ea428c6232f Mon Sep 17 00:00:00 2001 From: kubevirt-bot Date: Thu, 15 Sep 2022 14:16:28 +0100 Subject: [PATCH] hack/release, Introduce eventually to resource upload (#1418) Files are not uploaded when the release scripts runs. This is is probably due to a race between the creation of the release and the manifest being accesible to upload. Adding an eventually routine to aid the upload. Signed-off-by: Ram Lavi Signed-off-by: Ram Lavi Co-authored-by: Ram Lavi --- hack/release.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hack/release.sh b/hack/release.sh index b7bc2d8be..3ca14802d 100755 --- a/hack/release.sh +++ b/hack/release.sh @@ -1,5 +1,18 @@ #!/bin/bash -xe +function eventually() { + retries=2 + interval=2 + n=0 + until [ "$n" -ge $retries ] + do + $@ && break + n=$((n+1)) + sleep $interval + done + [ "$n" -lt $retries ] +} + make IMAGE_TAG=$TAG docker-build docker-push git tag $TAG @@ -11,8 +24,9 @@ $GITHUB_RELEASE release -u kubevirt -r cluster-network-addons-operator \ --description "$(./hack/render-release-notes.sh $(./hack/versions.sh -2) $TAG)" for resource in "$@" ;do - $GITHUB_RELEASE upload -u kubevirt -r cluster-network-addons-operator \ + eventually $GITHUB_RELEASE upload -u kubevirt -r cluster-network-addons-operator \ --name $(basename $resource) \ --tag $TAG \ + -R \ --file $resource done