NAME
git-deploy - Client for push notification deployment
DESCRIPTION
git-deploy runs as a git client daemon to pull the changes from the git server instantly after a push is triggered.
SYNOPSIS
git deploy
[ [--branch] <branch> ]
[ { --chdir | -C } <dir> ]
[ --umask <umask> ]
[ -O <option> ]
[ --build <command> ]
[ --fix-nasty ]
[ --background ]
[ --max-delay <seconds> ]
--branch <branch>
If a <branch> is specified, then it will update to that branch. By default, the current branch is used.
Example: git deploy --branch master
--OR--
Example: git deploy master
--chdir <dir>
Jump to <dir> prior to running "git pull". By default, the current directory is used.
Example: git deploy --chdir ~/projectx
--OR--
Example: git deploy -C ~/projectx
--umask <umask>
Set umask to <umask> in octal representation. This is useful when you need to set the umask prior to running any git commands.
Example: git deploy --umask 0022
-O <OPTION>
This -O may be used multiple times from commandline in order to pass multiple options to the server hooks. This has the same functionality as "git-client -O <OPTION>". Populates GIT_OPTION_* environment variables on server side. These ENV settings will be available to all the server side hooks, including the pre-* hooks.
--build <COMMAND>
The --build argument is any command you want to execute after any files are pulled or updated from git. By default, no command is run.
Example: git deploy --build='make -C src/.'
--fix-nasty
The --fix-nasty argument will automatically remove the offending SSH host entry for the git server from known_hosts. Only use this flag if you've changed the SSH server key on the git server host. By default, this option is disabled for better security.
Example: git deploy --fix-nasty
--background
The --background option will cause the deploy process to detach from its invoker and run in the background. This is useful when invoked from a cron since there is nobody around to see the output anyways. By default, this option is disabled so runs in the foreground.
Example: echo '7 * * * * git deploy --chdir ~/projectz --background' | crontab -
--max-delay <seconds>
The --max-delay specifies the maximum number of seconds to wait for each push notification. This is useful when you want to immediately release a previously deploying fetch and force pull updates from commandline without hanging the console waiting two hours until the next git push. By default, max-delay is 7200 seconds (or 2 hours).
Example: git deploy --max-delay 10
INSTALL
As super user:
[root@deploy-host ~]# wget -N -P /usr/bin https://raw.githubusercontent.com/hookbot/git-server/master/git-deploy
[root@deploy-host ~]# chmod 755 /usr/bin/git-deploy
[root@deploy-host ~]#
As deploy user:
[puller@deploy-host projectz]$ git deploy master
[puller@deploy-host projectz]$ echo '0 * * * * cd ~/projectz && git deploy >/dev/null 2>/dev/null' | crontab -
[puller@deploy-host projectz]$
AUTHOR
Rob Brown <bbb@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2015-2025 by Rob Brown <bbb@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.