Skip to content

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

Notifications You must be signed in to change notification settings

KamiAithein/ansible_githubwebhook_deployment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published