Git Fileserver Backend
With this backend, branches and tags in a remote git repository are exposed to salt as different environments.
To enable, add git
to the fileserver_backend
option in the
Master config file.
fileserver_backend:
- git
As of Salt 2014.7.0, the Git fileserver backend supports GitPython, pygit2, and dulwich to provide the Python interface to git. If more than one of these are present, the order of preference for which one will be chosen is the same as the order in which they were listed: pygit2, GitPython, dulwich (keep in mind, this order is subject to change).
An optional master config parameter (gitfs_provider
) can be used
to specify which provider should be used.
More detailed information on how to use gitfs can be found in the Gitfs Walkthrough.
Note
Minimum requirements
To use GitPython for gitfs requires a minimum GitPython version of 0.3.0, as well as the git CLI utility. Instructions for installing GitPython can be found here.
To use pygit2 for gitfs requires a minimum pygit2 version of 0.20.3. pygit2 0.20.3 requires libgit2 0.20.0. pygit2 and libgit2 are developed alongside one another, so it is recommended to keep them both at the same major release to avoid unexpected behavior. For example, pygit2 0.21.x requires libgit2 0.21.x, pygit2 0.22.x will require libgit2 0.22.x, etc.
To find stale refs, pygit2 additionally requires the git CLI utility to be installed.