Coder Social home page Coder Social logo

fraggle's Introduction

What is fraggle

A command line utility to deploy different versions of nodejs applications. You define a main host (i.e: www.example.dev) and you can deploy different versions of your app, each one in its own subdomain (i.e: 1.www.example.dev, 2.www.example.dev and so on). Fraggle then:

  • Downloads the source code and changes the working directory to a given version (usually a tagged commit). At this moment only git repositories are supported.
  • Changes the proxy configuration to add the new host with that version. At this moment only haproxy is supported.

Getting started

You can install fraggle with `npm``

npm install fraggle -g

Create a new directory. For example services

mkdir services

Create an empty configuration file

echo '{}' > config.json

Create a haproxy.ejs template. You can use this example. Save (and modify if you want) the template as haproxy.ejs in the current directory.

Usage

Adding services

To add a service to the configuration file. Use:

fraggle add <domain> <repo> <executable-file>

For example:

fraggle add www.example.dev [email protected]:gimenete/myserver.git server.js

The executable file will be invoked with the port number in which it should listen as the frist parameter.

At this moment nothing is running. You just added a service to the configuration file. Now you need to deploy a version.

Deploying versions

To deploy a new version just use:

fraggle deploy <tag>.<domain>

For example:

fraggle deploy 1.www.example.dev

This will download the source code of the repository in a new directory: repos/1.www.example.dev checking out the given tag ('1' in this case). Fraggle will run the with an available port as first parameter, and will restar the proxy with the new configuration. It uses forever to keep it running forever :) And log files are stored inside the logs directory that will be created if does not exist.

At this moment you can browse http://1.www.example.dev to see the new deployed version.

Marking a version as the default one

Now you would want to have some version serving at http://www.example.dev You just need to use:

fraggle default <tag>.<domain>

For example:

fraggle default 1.www.example.dev

So you now can browse http://www.example.dev

Deleting versions

If you want to delete a version, you just need to do the following:

fraggle delete <tag>.<domain>

For example:

fraggle delete 1.www.example.dev

Fraggle will stop the service, and it also will delete the application directory and will restart the proxy with the new configuration.

Listing active services

You can list the active services by simply using:

fraggle list

It will show you the configured domains, with their versions, the port where they are running, and which of them is the default version (marked as PROD in the listing).

fraggle's People

Contributors

gimenete avatar

Stargazers

Alejandro Morales avatar ivan l. avatar Javier Loriente avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.