KamiAithein / ansible_githubwebhook_deployment

Automatically pulls a github repository when a push payload is sent from a webhook, copying to the appropriate directory. This was used in conjunction with another one of my projects and will automatically try to run a server.js node file in master

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ansible_githubwebhook_deployment

Uses ansible and github webhook to automatically pull from github when there is a push. Useful for remote servers.

requires ansible-playbook, express, and node

must be run with sudo permissions

server.js in webhookhandle listens to port 8000: If a post request is made then it looks for the ref field and figures out what branch was pushed to based on that. This is currently not secure (I didn't bother to learn how webhook secrets work or any authentication for this small project. I recommend you do)

The pull.yml playbook will be run which pulls the branch and then kills all node services running with the forever module, and then starts the server.js found in master. This was made for another project of mine so that last bit will probably be removed if you want to use it for your own purposes.

Credit: https://gist.github.com/devynspencer/effa29af449c46477ac71213210e7043 how to pull from a private repo on github

About

Automatically pulls a github repository when a push payload is sent from a webhook, copying to the appropriate directory. This was used in conjunction with another one of my projects and will automatically try to run a server.js node file in master


Languages

Language:JavaScript 100.0%