Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oroce/webhook-post-receive
receive github/bitbucket webhook, pull the repo, and run your command
https://github.com/oroce/webhook-post-receive
Last synced: about 1 month ago
JSON representation
receive github/bitbucket webhook, pull the repo, and run your command
- Host: GitHub
- URL: https://github.com/oroce/webhook-post-receive
- Owner: oroce
- Created: 2012-06-09T19:22:20.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-06-09T20:16:06.000Z (over 12 years ago)
- Last Synced: 2024-04-14T14:46:02.014Z (9 months ago)
- Language: CoffeeScript
- Size: 93.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# webhook-post-receive #
a simple app to receive github/bitbucket webhook, `git pull` in your working directory, and restart your app. it's not for production server, only for development one.
## how to use ##
- You have a app which uses git, name it `example-app`
- You a dev server, where you have an `example-user` unix user, who runs the app.
- I use for running my apps [supervisord](http://supervisord.org/).
Here's the config.
/etc/supervisor/conf.d/exampleapp.conf
[program:exampleapp]
command: coffee server.coffee
user: exampleuser
directory: /home/exampleuser/example-app- Give access to `supervisorctl` for `exampleuser`
sudo visudo
# User alias specification
exampleuser ALL=(root)NOPASSWD:/usr/bin/supervisorctl restart exampleapp- So here's your config for app:
{
"example-app": {
"directory": "/home/exampleuser/example-app",
"user": "exampleuser",
"postCommand": "sudo /usr/bin/supervisorctl restart exampleapp"
},
"server": {
"port": 3300
}
}- Start this app, via `coffee app.coffee` or use supervisord:
sudo nano /etc/supervisor/conf.d/webhook.conf
[program:webhook]
command: coffee app.coffee
user: root
directory: /home/[youruser]/webhook-post-receive
sudo supervisorctl start webhook- Setup a webhook to `http://[your-host]:3500`
- 8. Be happy:)