first commit

This commit is contained in:
RDF 2022-09-15 11:56:49 -03:00
parent 2555d78680
commit e957362802
9 changed files with 58 additions and 0 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "Ansible"]
path = Ansible
url = https://git.mps.org.uy/MPS/MPS-Ansible.git

1
Ansible Submodule

@ -0,0 +1 @@
Subproject commit b380c25fc27f3fc19572a8b4a99050ea30b060fd

View File

View File

View File

@ -0,0 +1,6 @@
ldap:
instance: {}
servicePlaybook: OpenLDAP.yml
Git:
instance: {}
servicePlaybook: GitTea.yml

View File

View File

34
Hooks/pre-commit.j2.bash Normal file
View File

@ -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

14
init.playbook.yml Normal file
View File

@ -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