From ab4fb9bbfaabccc99e30dd104352dd110f3fd6bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Fri, 9 Aug 2013 18:18:33 -0700 Subject: [PATCH] Add a check for S3 bucket access. --- release.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/release.sh b/release.sh index 4d589e3126..f029435296 100755 --- a/release.sh +++ b/release.sh @@ -40,11 +40,16 @@ EOF cd /go/src/github.com/dotcloud/docker/ VERSION=$(cat VERSION) -BUCKET=s3://$AWS_S3_BUCKET +BUCKET=$AWS_S3_BUCKET setup_s3() { # Try creating the bucket. Ignore errors (it might already exist). s3cmd --acl-public mb $BUCKET 2>/dev/null || true + # Check access to the bucket. + # s3cmd has no useful exit status, so we cannot check that. + # Instead, we check if it outputs anything on standard output. + # (When there are problems, it uses standard error instead.) + s3cmd info s3://$BUCKET | grep -q . } # write_to_s3 uploads the contents of standard input to the specified S3 url.