diff --git a/addblob.sh b/addblob.sh index 64ff410b..aa088c2c 100755 --- a/addblob.sh +++ b/addblob.sh @@ -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 @@ -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 @@ -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 \ No newline at end of file