gitservconf/.git_hooks/post-update
2024-08-12 16:26:09 +02:00

13 lines
392 B
Bash
Executable file

#!/bin/bash
BRANCH=$(git rev-parse --symbolic --abbrev-ref $1)
RP="${PWD#/srv/git/}"
echo "Creating minio backup."
git bundle create repo.bundle --all
mcli mv "$PWD/repo.bundle" "hs/git/$PWD/repo.bundle"
echo "Repository $RP backed up to minio."
echo "Sending cicd push webhook"
curl -s -o /dev/null -w "" https://n8n.davidon.top/webhook/git/push/$RP/$BRANCH
echo "Sent cicd push webhook"