https://github.com/aspyatkin/agit-cookbook
A safer replacement for Chef git resource
https://github.com/aspyatkin/agit-cookbook
chef-cookbook git ssh-agent-forwarding
Last synced: about 2 months ago
JSON representation
A safer replacement for Chef git resource
- Host: GitHub
- URL: https://github.com/aspyatkin/agit-cookbook
- Owner: aspyatkin
- License: mit
- Created: 2019-03-21T11:02:08.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-16T10:09:31.000Z (about 7 years ago)
- Last Synced: 2025-03-04T12:43:48.713Z (over 1 year ago)
- Topics: chef-cookbook, git, ssh-agent-forwarding
- Language: Ruby
- Homepage: https://supermarket.chef.io/cookbooks/agit
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# agit cookbook
A safer replacement for Chef git resource.
## Concept
Chef git resource is rather user-unfriendly. It is notoriously difficult to find a combination of `checkout_branch`, `enable_checkout` and `revision` so that all works perfectly.
There are several major improvements introduced by this cookbook.
Firstly, only one attribute is used to control a repository's `HEAD` (current branch).
Secondly, changes in a local copy of the repository are respected. The current branch will not be changed if the repository's state is "dirty". Unlike Chef git resource `:sync` action, uncommited changes will not be reset.
Thirdly, SSH agent forwarding is fully supported.
## Usage
```
agit '/opt/hello' do
repository 'git@github.com:acme/hello.git'
branch 'develop'
user 'vagrant'
group 'vagrant'
action :update
end
```
## Notes
Regarding SSH agent forwarding it is important to include `agit::cleanup` recipe into a node's run list. During Chef client run `agit` alters the permissions of the forwarded SSH agent socket (the value is stored in `SSH_AUTH_SOCK` environment variable). Cleanup recipe restores those permissions.
## License
MIT @ [Alexander Pyatkin](https://github.com/aspyatkin)