Installs git_client from package or source. Optionally sets up a git service under xinetd.
This cookbook is concerned with the Git SCM utility. It does not address ecosystem tooling or related projects.
This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit sous-chefs.org or come chat with us on the Chef Community Slack in #sous-chefs.
The following platforms have been tested with Test Kitchen:
|---------------+-------|
| amazonlinux-2 | X |
|---------------+-------|
| centos-7 | X |
|---------------+-------|
| centos-8 | X |
|---------------+-------|
| fedora | X |
|---------------+-------|
| debian-9 | X |
|---------------+-------|
| debian-10 | X |
|---------------+-------|
| ubuntu-16.04 | X |
|---------------+-------|
| ubuntu-18.04 | X |
|---------------+-------|
| ubuntu-20.04 | X |
|---------------+-------|
| openSUSE Leap | X |
|---------------+-------|
- Chef 15.3+
- ark (for
git_client
source install)
Include git::default
, git::windows
, or git::source
in your cookbook OR use the git_client
resource directly.
git_client
: Manages a Git client installation on a machine. Source install action is available on Linux.git_service
: Sets up a Git service via xinetd. WARNING: This is insecure and will probably be removed in the futuregit_config
: Sets up Git configuration on a node.
The git_client
resource manages the installation of a Git client on a machine.
Note
: on macOS systems homebrew must first be installed on the system before running this resource. Prior to version 9.0 of this cookbook homebrew was automatically installed.
git_client 'default'
git_client 'source' do
source_version '2.14.2'
source_checksum 'a03a12331d4f9b0f71733db9f47e1232d4ddce00e7f2a6e20f6ec9a19ce5ff61'
action :install_from_source
end
The git_config
resource manages the configuration of Git client on a machine.
git_config 'url.https://github.com/.insteadOf' do
value 'git://github.com/'
scope 'system'
options '--add'
end
Currently, there are distinct sets of resource properties, used by the providers for source, package, macos, and windows.
package_name
- Package name to install on Linux machines. Defaults to a calculated value based on platform.package_version
- Defaults to nil.package_action
- Defaults to:install
source_prefix
- Defaults to '/usr/local'source_url
- Defaults to a calculated URL based on source_versionsource_version
- Defaults to 2.8.1source_use_pcre
- configure option for build. Defaults to falsesource_checksum
- Defaults to a known value for the 2.8.1 source tarball
windows_display_name
- Windows display namewindows_package_url
- Defaults to the Internetwindows_package_checksum
- Defaults to the value for 2.8.1
This cookbook ships with ready to use, attribute driven recipes that utilize the git_client
and git_service
resources. As of cookbook 4.x, they utilize the same attributes layout scheme from the 3.x. Due to some overlap, it is currently impossible to simultaneously install the Git client as a package and from source by using the "manipulate the node attributes and run a recipe" technique. If you need both, you'll need to utilize the git_client resource in a recipe.
node['git']['version']
- git version to installnode['git']['url']
- URL to git packagenode['git']['checksum']
- package SHA256 checksumnode['git']['display_name']
-windows_package
resource Display Name (makes the package install idempotent)
node['git']['prefix']
- git install directorynode['git']['version']
- git version to installnode['git']['url']
- URL to git tarballnode['git']['checksum']
- tarball SHA256 checksumnode['git']['use_pcre']
- if true, builds git with PCRE enabled
This project exists thanks to all the people who contribute.
Thank you to all our backers!
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.