3 ms·
How to deploy your code from GitHub automatically
- progrium 16y agolol, webhooks
- markchristian 16y agoYeah, that was my first thought, too.
- sabat 16y agoSecurity issues abound, although I'm sure there are ways to make this adequately safe to do. Me, I do something vaguely similar, but using Dropbox instead. The webserver is running on a git repo that is in a Dropbox. When I commit and push to the repo (locally) the webserver picks up the changes automatically.
- generalk 16y agoSoon: google for 'inurl:github_update.php' and click each result. Better alternative: use something like Capistrano to automate deployments. It's not Heroku-style automatic after a push, but it's pretty close. Still, points for ingenuity.
- zbanks 16y agogithub_update.php wouldn't be linked to by any of your pages, so it shouldn't show up in the google index. You could also force it to accept some password as a GET parameter for a wee bit more security. I agree though, this is still a really simple way to automate deployment.
- markchristian 16y agoNote that I didn't actually call my own github_update.php, and there's no reason for anyone else to — call it whatever you'd like.
- Udo 16y agoThere are lots of web apps that use update mechanisms like this one. Back in the bad old days, I remember writing something that synced code files by using some convoluted homebrew json protocol. Anyway, the point is: this kind of functionality is normally restricted by the web app, usually requiring admin privileges or some form of authentication. For example, at work, we have a similar function that pulls down the current SVN repository onto the web servers. We've been doing this for years, it works great - but that doesn't mean people can just call these URLs from the outside. I also believe choosing an obfuscating name for the update file is not sufficiently secure.
- calloc 16y agoHow about just adding the Git repo as a remote, and pushing to it over SSH?
- markchristian 16y agoThe point was magic, automatic updates.
- xorglorb 16y agoAlso, why should a web server have R+W access to a directory it's serving? It should be RO, or at worst, R+X. (Excluding an uploads directory)
- Udo 16y agoWell, (semi) automatic updates would be one use case, as the article details. Furthermore, many apps do require write access to at least a couple of directories to write log files and static content.