This project has been deprecated and replaced by DServe. Check that out instead.
A proxy server which checkouts a branch of your web application and runs it on demand.
Clone this repository and install the dependencies:
git clone https://github.com/Automattic/calypso-live-branches.git
cd calypso-live-branches
npm install
Run your app with node lib/index.js <URL_TO_YOUR_REPOSITORY>.
If your packages.json has all the information to build and run your app chances are it might just work. Otherwise you can create a new JSON file whose config will overwrite your package.json and run it with:
node lib/index.js my-config.json
For instance in Calypso we use make build to build our app and since it itself calls npm install we cannot use the default preinstall or postinstall hooks. So calypso-live-branches looks for the special scripts.build attribute. See calypso.json for an exemple of configuration.
Finally, use the watchDirs option if you want to avoid restarting your app on each change.
Run it with make run
- Display a page while instance is installing.
- Remove application specific code in
worker.js(iemake buildandrequire('build/bundle-development.js');). - Monitor workers: restart failed workers (or mark them as failing for this commit), shutdown unused workers.
- Create a Dockerfile.
- Handle erroring branches.
- Report errors.
- Shutdown unused branches after some time.
- Add unit tests.
- Make a cli and publish it as an npm package.
- Find alternatives to
requireto launch the server with the patch onnet.Server.listen(needed so we can proxy it); have a look atnode-sandboxed-module.