From e8cd528b42ffe794e6406bc8136ce293723ef85d Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sun, 30 Jun 2019 15:53:49 +0900 Subject: [PATCH] [Release][Upload] Skip already uploaded file --- dev/release/03-binary.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dev/release/03-binary.sh b/dev/release/03-binary.sh index 74602cda749..f3f418ca641 100755 --- a/dev/release/03-binary.sh +++ b/dev/release/03-binary.sh @@ -73,6 +73,8 @@ fi : ${BINTRAY_REPOSITORY:=apache/arrow} : ${SOURCE_BINTRAY_REPOSITORY:=${BINTRAY_REPOSITORY}} +BINTRAY_DOWNLOAD_URL_BASE=https://dl.bintray.com + docker_run() { docker \ run \ @@ -194,7 +196,7 @@ download_files() { --fail \ --location \ --output ${file} \ - https://dl.bintray.com/${SOURCE_BINTRAY_REPOSITORY}/${file} & + ${BINTRAY_DOWNLOAD_URL_BASE}/${SOURCE_BINTRAY_REPOSITORY}/${file} & done } @@ -244,6 +246,16 @@ sign_and_upload_file() { local local_path=$4 local upload_path=$5 + local sha256=$(shasum -a 256 ${local_path} | awk '{print $1}') + local download_path=/${BINTRAY_REPOSITORY}/${target}-rc/${upload_path} + if curl \ + --fail \ + --head \ + ${BINTRAY_DOWNLOAD_URL_BASE}${download_path} | \ + grep -q "^X-Checksum-Sha2: ${sha256}"; then + return 0 + fi + upload_file ${version} ${rc} ${target} ${local_path} ${upload_path} local suffix=