Stark & Wayne

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:

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.