This repository has been archived on 2020-01-17. You can view files and clone it, but cannot push or open issues or pull requests.
vn-repo/git-hooks/post-receive

21 lines
410 B
Bash
Executable File

#!/bin/bash
set -e
while read oldrev newrev ref
do
if [[ ! $ref =~ .*/master$ ]]
then
continue
fi
myHost=$(hostname)
repoDir=$(dirname "$0")/..
projectName=$(basename "$(realpath "$repoDir")")
echo "Ref $ref received. It will be deployed automatically."
echo "Host $myHost"
echo "$projectName" "master" > /tmp/vn-repo.changes
#nohup sudo -u vn-repo "vn-branch $projectName" &> /dev/null &
done