Tips Integrating CI & Git
-
store large files outside your repo
- use an External Storage System or Artifact Repository Manager (BRM - ARM) (e.g. Artifactory, Nexus, Archiva, etc)
- Git Large File Support (Git LFS) - is an extension that stores pointers to large files in your repository, instead of storing the files themselves. The files themselves are stored on a remote server
-
use shallow clones for CI
- with shallow clones, only the current snapshot of your repo will be pulled down
git clone —depth 1 [remote-repository-url]
- with shallow clones, only the current snapshot of your repo will be pulled down
-
cache the repo on build agents
- repo caching only benefits you if you’re using agents that persist from build to build
shallow clones + repo caching, divided by persistent vs. elastic agents, equals an interesting web of factors. Here’s a little matrix to help you strategize:
|
Shallow Clones |
Repo Caching | ||
|---|---|---|---|
|
persistent agents |
No Changes |
✓ |
✓ |
|
Simple Changes |
✓ |
✓ | |
|
Auto-Merging |
✘ |
✓ | |
|
elastic agents |
No Changes |
✓ |
✘ |
|
Simple Changes |
✓ |
✘ | |
|
Auto-Merging |
✘ |
✘ | |