Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pixelated/puppet-git-hooks
Git client and server side hooks for puppet development
https://github.com/pixelated/puppet-git-hooks
Last synced: 5 days ago
JSON representation
Git client and server side hooks for puppet development
- Host: GitHub
- URL: https://github.com/pixelated/puppet-git-hooks
- Owner: pixelated
- License: gpl-2.0
- Fork: true (drwahl/puppet-git-hooks)
- Created: 2015-03-17T09:53:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-06-28T18:38:34.000Z (over 8 years ago)
- Last Synced: 2024-08-02T12:51:03.653Z (3 months ago)
- Language: Shell
- Size: 124 KB
- Stars: 1
- Watchers: 29
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - pixelated/puppet-git-hooks - Git client and server side hooks for puppet development (others)
README
Looking for additional maintners. I do not use puppet on a daily basis anymore, so I'd appreciate an extra
help ensuring this project meets the needs of the people using it. Please contact me through github if you
are interested in helping maintain this project. Thank you!puppet-git-hooks
================Git hooks to assist puppet module development. Client side hooks allow for various checks before commits are staged. Server side hooks are provided for infrastructural reinforcement of various standardization compliances.
Current supported pre-commit (client side) checks
=================================================* Puppet manifest syntax
* Puppet epp template syntax
* Erb template syntax
* Puppet-lint
* Rspec-puppet
* Yaml (hiera data) syntax
* r10k puppetfile syntaxCurrent supported pre-receive (server side) checks
==================================================* Puppet manifest syntax
* Puppet epp template syntax
* Erb template syntax
* Ruby syntax
* Puppet-lint
* Yaml (hiera data) syntaxPrerequisites
=============These hooks depend on the follwing packages installed:
* puppet
* puppet-lintEither install them as gem or as package provided by your distribution.
Usage
=====In your git repository you can symlink the pre-commit file from this repository to the .git/hooks/pre-commit of your repository you want to implement this feature.
```bash
$ ln -s /path/to/this/repo/puppet-git-hooks/pre-commit .git/hooks/pre-commit
```If you are using git submodules this can be achieved by getting the gitdir from the .git file in your submodule and symlinking to that gitdir location/
```bash
$ cat .git
$ ln -s /path/to/this/repo/puppet-git-hooks/pre-commit ../path/to/git/dir/from/previous/command/hooks/pre-commit
```deploy-git-hook
===============usage: deploy-git-hook -d /path/to/git/repository [-a] [-c] [-r] [-u]
-h this help screen
-d path install the hooks to the specified path
-a deploy pre-commit and pre-receive hooks
-c deploy only the pre-commit hook
-r deploy only the pre-receive hook
-u deploy only the post-update hook
-g enable to install in Git Lab repo custom_hooksreturns status code of 0 for success, otherwise, failure
examples:
1) to install pre-commit and pre-receive the hooks to foo git repo:
deploy-git-hook -d /path/to/foo -a
2) to install only the pre-commit hook to bar git repo:
deploy-git-hook -d /path/to/bar -c
3) to install only the pre-commit and pre-receive hook to foobar git repo:
deploy-git-hook -d /path/to/foobar -c -r
In a wrapper
===============
You can call from your own custom pre-commit. This allows you to combine these with your own checksFor example, if you've cloned this repo to ~/.puppet-git-hooks
The .git/hooks/pre-commit with your puppet code might look like this
```bash
#!/bin/bash# my_other_checks
# puppet-git-hooks
if [ -e ~/.puppet-git-hooks/pre-commit ]; then
~/.puppet-git-hooks/pre-commit
fi
```