All Projects → Automattic → Calypso Live Branches

Automattic / Calypso Live Branches

Licence: gpl-2.0
Access versions of your node.js application on demand

Programming Languages

javascript
184084 projects - #8 most used programming language

Calypso Live Branches

A proxy server which checkouts a branch of your web application and runs it on demand.

Install

Clone this repository and install the dependencies:

git clone https://github.com/Automattic/calypso-live-branches.git
cd calypso-live-branches
npm install

Generic Usage

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.

Usage for Calypso

Run it with make run

TODO

  • [x] Display a page while instance is installing.
  • [x] Remove application specific code in worker.js (ie make build and require('build/bundle-development.js');).
  • [x] Monitor workers: restart failed workers (or mark them as failing for this commit), shutdown unused workers.
  • [x] Create a Dockerfile.
  • [x] Handle erroring branches.
  • [x] Report errors.
  • [ ] Shutdown unused branches after some time.
  • [ ] Add unit tests.
  • [ ] Make a cli and publish it as an npm package.
  • [ ] Find alternatives to require to launch the server with the patch on net.Server.listen (needed so we can proxy it); have a look at node-sandboxed-module.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].