Alain.xyz Daemon
A Continuous Delivery service that automatically updates the server from github push events.
How It Works
Github sends a push event to an endpoint on https://alain.xyz/api/v1/github, which is mapped to the daemon on nginx.
location /api/v1/github {
proxy_pass http://localhost:3030;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}The daemon in turn:
- Does an HMAC SHA1 check to verify that this was indeed github.
git pullthe repo.npm startif the push event included files in the portfolio (by checkingcommits).pkill node && npm startif the push event included files in the backend.npm startif the push event included files in the frontend.