3 ms·
Love this idea. For small apps, I often just do a git push, ssh to server, git pull, restart app. It sounds like this might make this flow even more simple.
by morganherlocker 13y ago
Love this idea. For small apps, I often just do a git push, ssh to server, git pull, restart app. It sounds like this might make this flow even more simple.
- tcdent 13y agoThis doesn't interact with your server at all. Look into Fabric for scripting your remote SSH commands. http://fabfile.org http://fabfile.org
- ivanca 13y ago...It actually interacts with your server; that's pretty much the main thing it does, being the server the "third-party service". Deployments are a request for a specific ref(branch,sha,tag) to be deployed. GitHub then dispatches deployment events that external services can listen for and act on. http://developer.github.com/v3/repos/deployments/ http://developer.github.com/v3/repos/deployments/
- deleted 13y ago[deleted]
- tcdent 13y ago> Keep in mind that GitHub is never actually accessing your servers. It’s up to your 3rd party integration to interact with deployment events. A paragraph or two down the page you linked.
- deleted 13y ago[deleted]
- ivanca 13y agoYeah, but that's the important bit. After that you (probably) just need a few lines of code: import git import fs handle = fs.open('config.php', 'w+') config = handle.read() git.start('./') git.auth('rsa_pub') git.clone('git@github.com:foo/bar.git') git.remove_untracked() handle.write('config.php', config)
- mkaito 13y agoI've had git hooks do this for me for years. I have my hook check for pushes to a branch called "production", export the code (git archive | tar), run some unit tests, and then do whatever it takes to get the code to its destination and restart what needs to be restarted.