Skip to content

Commit

Permalink
Refine addblob.sh to upload blobs to s3 (fixup)
Browse files Browse the repository at this point in the history
Call bosh upload-blobs after all blobs were added
  • Loading branch information
gberche-orange committed Jan 2, 2024
1 parent 9a58931 commit e1b7b7a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions addblob.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
set -x
set -e # exit on non-zero status

echo "Current blobs"
bosh blobs

NEW_BLOBS_WERE_ADDED="false"

# params
# $1: src
# $2: target
Expand All @@ -13,11 +18,11 @@ function addBlobOnChecksumChange() {
src_checksum=$(cat "${src}" | sha256sum | cut -d " " -f1)
if [ "${blob_checksum}" != "sha256:${src_checksum}" ] || [ "$blob_object_id" = "null" ]; then
bosh add-blob ${src} ${target}
# See https://bosh.io/docs/release-blobs/#saving-blobs
bosh upload-blobs
NEW_BLOBS_WERE_ADDED="true"
else
echo "skipping blob creation for ${target} with existing checksum: ${src_checksum}"
fi

}

addBlobOnChecksumChange src/github.com/k3s-io/k3s/k3s k3s/k3s
Expand All @@ -26,3 +31,7 @@ chmod ugo+x src/github.com/kubernetes/kubectl/kubectl
addBlobOnChecksumChange src/github.com/kubernetes/kubectl/kubectl kubectl/kubectl


if [ "${NEW_BLOBS_WERE_ADDED}" == "true" ] ; then
# See https://bosh.io/docs/release-blobs/#saving-blobs
bosh upload-blobs
fi

0 comments on commit e1b7b7a

Please sign in to comment.