Skip to content

Commit

Permalink
Refine addblob.sh to configure S3 blobstore prior to upload blob
Browse files Browse the repository at this point in the history
  • Loading branch information
gberche-orange committed Jan 2, 2024
1 parent 82087d4 commit 3864184
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions addblob.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,27 @@ chmod ugo+x src/github.com/kubernetes/kubectl/kubectl
addBlobOnChecksumChange src/github.com/kubernetes/kubectl/kubectl kubectl/kubectl


# Inspired by https://github.com/orange-cloudfoundry/bosh-release-action/blob/8732ff085712d9980fc66e50892cb9c3d7a3f884/entrypoint.sh#L48-L58
function configureS3BlobStore() {
if [ ! -z "${AWS_BOSH_ACCES_KEY_ID}" ]; then
cat - > config/private.yml <<EOS
---
blobstore:
options:
access_key_id: ${AWS_BOSH_ACCES_KEY_ID}
secret_access_key: ${AWS_BOSH_SECRET_ACCES_KEY}
EOS
else
echo "::warning::AWS_BOSH_ACCES_KEY_ID not set, skipping config/private.yml"
fi
}


if [ "${NEW_BLOBS_WERE_ADDED}" == "true" ] ; then
echo "Current blobs before upload"
bosh blobs

configureS3BlobStore
# See https://bosh.io/docs/release-blobs/#saving-blobs
bosh upload-blobs

Expand Down

0 comments on commit 3864184

Please sign in to comment.