Here's what I'd like to do in concept:
"Hook" node.js to a particular Git repository so that I can make a request like /84de7e8d8ce33/foo and the server will (if necessary) check out commit 84de7e8d8ce33, start up another node.js on the files it just checked out, and pass "/foo" to that new server. Of course, the main server keeps track of which commits it already knows about.
Basically, I'm just trying to simplify our release process, so the same server that does the above Git magic will also serve an index.html-like file that consists almost entirely of
<script src="/84de7e8d8ce33/app.js"></script>
My questions:
- Just how bad an idea is this?
- Is there some prior art, some library or framework that already does this?
- Is there an alternative? Some way that I have a release branch, tell node.js what commit to use, and let it go.
- Is there some built-in way of keeping multiple commits "checked out" (or at least visible as ordinary files in some fashion) at the same time?
(I have a subsidiary question about how to communicate, from me, as the release manager, to the server the fact that 84de7e8d8ce33 is now the live version. Right now, I'm thinking, memcached, but I'm open to other suggestions.)