It's been working great for storage, but if you need to clean your workspace every build, you end up dumping your local LFS cache. Shared LFS CacheĪs I said at the top of the post, I use a home-grown serverless Git LFS implementation on Amazon S3. There's probably a reason for it, but I didn't have the energy to investigate, so I adjusted the commands my build runs to: $ git config -unset core.hooksPathĪll fixed! We can use git config -list -show-origin to verify. Jenkins did that when checking out the Git repo. Looking at our friend git config again: $ git config -list -show-origin Weird! Why is it trying to write the pre-push hook to the Windows equivalent of /dev/null? Well, the clue was in the config. \NUL:\pre-push: The filename, directory name, or volume label syntax is incorrect.ġ: run `git lfs update -manual` for instructions on how to merge hooks.Ģ: run `git lfs update -force` to overwrite your hook. On the Windows build machine, setting up LFS manually in the root of the Git repo kept failing with a cryptic error: $ git lfs install The global system config, and my user config! OK, let's undo that (run the below commands outside of the git repo): $ git lfs uninstallĪ quick check of git config -list -show-origin again shows the entries removed, and Jenkins no longer automatically pulls from LFS. Git has multiple levels of configuration, but fortunately it has great tooling to help understand where each bit of config is coming from: $ git config -list -show-originįile:C:/Program Files/Git/etc/gitconfig =git-lfs clean - %fįile:C:/Program Files/Git/etc/gitconfig =git-lfs smudge - %fįile:C:/Program Files/Git/etc/gitconfig =git-lfs filter-processįile:C:/Program Files/Git/etc/gitconfig =trueįile:C:/Users/alan/.gitconfig =git-lfs clean - %fįile:C:/Users/alan/.gitconfig =git-lfs smudge - %fįile:C:/Users/alan/.gitconfig =git-lfs filter-processįile:C:/Users/alan/.gitconfig =true So, clearly something other than Jenkins is configured to pull from LFS. I explicitly wanted Jenkins to check out the Git repo without pulling LFS, because I had some configuration to apply which Jenkins couldn't do itself (like using a network level LFS cache). Read on for the retrospective write-up of the problems and how I fixed them. This stopped working when I upgraded the components involved. Set up Git LFS credentials to obtain objects not in the cache.Set up Git LFS to use a shared LFS cache.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |