Skip to content

Commit 9821460

Browse files
committed
do not reupload existing files to s3
1 parent 6b92898 commit 9821460

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bin/upload-to-mirror

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ mirror() {
107107
package_url=$1
108108
expected_checksum=$2
109109

110+
# skip anything we already have on S3
111+
# this only checks filename and not etag, so a bad upload will still trigger this
112+
[[ "$s3_bucket_contents" == *"$expected_checksum"* ]] && return 1
110113

111114
mkdir -p /tmp/ruby-build/
112115
package_filename="/tmp/ruby-build/${expected_checksum}"
@@ -125,6 +128,7 @@ mirror() {
125128
}
126129

127130

131+
s3_bucket_contents=`s3cmd ls s3://$S3_BUCKET`
128132
for def in $(ruby_definitions); do
129133
checksum="${def#*#}"
130134
package_url="${def%%#*}"

0 commit comments

Comments
 (0)