first commit
This commit is contained in:
parent
2555d78680
commit
e957362802
|
@ -0,0 +1,3 @@
|
|||
[submodule "Ansible"]
|
||||
path = Ansible
|
||||
url = https://git.mps.org.uy/MPS/MPS-Ansible.git
|
|
@ -0,0 +1 @@
|
|||
Subproject commit b380c25fc27f3fc19572a8b4a99050ea30b060fd
|
|
@ -0,0 +1,6 @@
|
|||
ldap:
|
||||
instance: {}
|
||||
servicePlaybook: OpenLDAP.yml
|
||||
Git:
|
||||
instance: {}
|
||||
servicePlaybook: GitTea.yml
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
shopt -s nullglob
|
||||
declare -a FILES
|
||||
declare -a HIT
|
||||
|
||||
echo "Git hook executing: pre-commit..."
|
||||
|
||||
# dump staged filenames into FILES array
|
||||
FILES=(`git diff --cached --name-only --diff-filter=ACM`)
|
||||
|
||||
n=0
|
||||
for i in "${FILES[@]}"; do
|
||||
WARN=`file --mime "${i}" | grep -i binary`
|
||||
NAME=`file "${i}" | cut -d":" -f1`
|
||||
|
||||
if [ -n "${WARN}" ]; then
|
||||
HIT[$n]="${NAME}"
|
||||
WARN=""
|
||||
echo "${NAME} appears to be a binary blob."
|
||||
exit 1
|
||||
elif [[ "${NAME}" == *"blah" ]]; then
|
||||
true
|
||||
# do some stuff here
|
||||
else
|
||||
true
|
||||
# do some other stuff here
|
||||
fi
|
||||
let "n++"
|
||||
done
|
||||
|
||||
if [ ${#HIT[@]} -gt 0 ]; then
|
||||
echo " WARNING: Binary data found"
|
||||
fi
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
# On localhost
|
||||
|
||||
- hosts: localhost
|
||||
tasks:
|
||||
- shell: "git submodule init"
|
||||
- shell: "git submodule update --remote --merge"
|
||||
- with_fileglob: Hooks/*.j2.*
|
||||
ansible.builtin.copy:
|
||||
src: "{{item}}"
|
||||
dest: ".git/hooks/{{ item | split('/') | last | split('.') | first }}"
|
||||
|
||||
# Init submodules
|
||||
# Install Githooks
|
Loading…
Reference in New Issue