Welcome to FreeSoftwareServers Confluence Wiki

The user git  runs post-receive hooks configured. The home directory is under data/git/.ssh

Add RSA key there and then access the cli and test/accept thumbprint

To configure, get to your docker terminal and use the following sequence to test script:

su git
ssh root@server
ssh root@server -f "/script"

Then in the UI got to your repo settings and "Git Hooks" and this is how I configured things:

#!/bin/sh
#
# An example hook script for the "post-receive" event.
#
# The "post-receive" script is run after receive-pack has accepted a pack
# and the repository has been updated.  It is passed arguments in through
# stdin in the form
#  <oldrev> <newrev> <refname>
# For example:
#  aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master

while read oldrev newrev refname
do
    branch=$(git rev-parse --symbolic --abbrev-ref $refname)
    if [ "dev" = "$branch" ]; then
        # Do something
        ssh root@server -f "/opt/git/hooks/hook.sh"
    fi
done
  • No labels