logo

drewdevault.com

[mirror] blog and personal website of Drew DeVault git clone https://hacktivis.me/git/mirror/drewdevault.com.git

Hooks.md (933B)


  1. ---
  2. date: 2015-04-19
  3. # vim: tw=80
  4. title: Hooks - running stuff on Github hooks
  5. layout: post
  6. ---
  7. I found myself in need of a simple tool for deploying a project on every git
  8. commit, but I didn't have a build server set up. This led to Hooks - a very
  9. simple tool that allows you to run arbitrary commands when Github's hooks
  10. execute.
  11. The configuration is very simple. In `/etc/hooks.conf`, write:
  12. [truecraft]
  13. repository=SirCmpwn/TrueCraft
  14. branch=master
  15. command=systemctl restart hooks
  16. valid_ips=204.232.175.64/27,192.30.252.0/22,127.0.0.1
  17. You may include any number of hooks. The `valid_ips` entry in that example
  18. allows you to accept hooks from Github and from localhost. Then you run Hooks
  19. itself, it will execute your command when you push a commit to your repository.
  20. This allows you to do continuous deployment on the cheap and easy. I hope you
  21. find it useful. [Hooks](https://github.com/SirCmpwn/hooks).