BOSH releases with Git LFS

Using an external blobstore for your BOSH release is considered a best practice, since you don’t want to pollute your git repo with big files. However there are some downsides to this approach:

  • Need a AWS or GCP account; or need an internal compatible blobstore
  • Sharing manage credentials to upload blobs (private.yml)
  • Restricted environments sometimes don’t allow access to Internet
  • Pull Requests to update blobs might not be possible for people without accsss to secret credentials

Luckily there is another option, Git Large File Storage (LFS). It works with GitHub and GitLab. Using it with your newly created boshrelease is really easy. We switch to the local blobstore provider:

DIR=foo-boshrelease
bosh init-release --git --dir=${DIR}
cat <<EOT >> ${DIR}/config/final.yml
blobstore:
  provider: local
  options:
    blobstore_path: final_blobs
EOT
cat <<EOT > ${DIR}/.gitattributes
/blobs/** filter=lfs diff=lfs merge=lfs -text
/final_blobs/** filter=lfs diff=lfs merge=lfs -text
EOT

After this, files created by bosh add-blobs and bosh create-release --final can be committed to your repo with git commit and will be stored with git lfs. No more need for bosh sync-blobs, instead just git commit && git push.

Spread the word

twitter icon facebook icon linkedin icon