diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 0000000..d459a36 --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,9 @@ +- id: kapitan-compile + name: Kapitan Compile + description: Compiles Kapitan templates in the repository + entry: hooks/kapitan-compile.sh + language: script + files: ^(components|templates|inventory|secrets).+\.ya?ml$ + exclude: ^compiled + pass_filenames: false + diff --git a/README.md b/README.md new file mode 100644 index 0000000..3448191 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# pre-commit + +A collection of pre-commit hooks for [https://github.com/pre-commit/pre-commit](https://github.com/pre-commit/pre-commit). + +## Hooks + +- **kapitan-compile**: Compiles [Kapitan](https://kapitan.dev) templates + diff --git a/hooks/kapitan-compile.sh b/hooks/kapitan-compile.sh new file mode 100755 index 0000000..b5bce27 --- /dev/null +++ b/hooks/kapitan-compile.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -e + +docker run -t --rm -v $(pwd):/src:delegated deepmind/kapitan compile +