Really just the title, I was wondering if any of the git-hooks (update or post-receive) are called (or are supposed to be called) after a repo has been synced from another source?
I’d like to deploy the files to a folder after the sync has occurred.
I have a post-recieve script I normally use to deploy web sites from Gitea but it doesn’t fire when the repository is a mirror that gets pushed too from another instance. The push is successfully occurring - not sure the script is running.
Or possibly it is running but not working, it relies on parsing the branch name from refname:
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ "production" == "$branch" ]; then
if [ -d "${git_work_tree}"/production ]; then
git_clean production
git_checkout production
else
create_work_dir production
git_checkout production
fi
I suppose I need to dig into the git repos on the server and check logs…
but when I try with a no-mirrored repo, after a push, I can see clearly the post-receive.
“completed POST /api/internal/hook/post-receive/xxxx/hooktesting”
I tried to configure a git hook for a mirrored repo but It seems it never gets triggered on mirroring/sync action.
I added several test scripts in some of the git hooks ( pre-receive, update, post-receive).
The things I tried inside the scripts
1: create a test folder (with mkdir)
2: create a new branch
3: exit 1 (which should block the process if set on pre-receive git hook).
All of these worked just fine when I pushed into a repo (so I would say the actual script content is not the issue) but nothing worked on the mirrored repo.
I’m using Gitea on Docker Version: 1.21.0 (with MySql).
Any ideas? Does GITEA support git hooks on mirror/sync?