0.7.1 • Published 9 years ago

lurkle v0.7.1

Weekly downloads
6
License
ISC
Repository
-
Last release
9 years ago

Lurkle

Lurkle is a CLI for managing the development environment of micro-services. It coordinates running scripts and starting services across multiple directories.

Install

npm install -g lurkle
yarn global add lurkle

Tasks

The lurkle CLI can be used to coordinate the running of tasks in multiple directories. Lurkles are groups of tasks that lurk in sub-folders. You can configure them either directly in a lurkle-config.yml file from your project root or you can create lurkle.yml files that are imported into your config.

Configuring Tasks

Create a lurkle-config.yml a root folder above your services. This contains a list of the locations to where your lurkles reside as well as a list of possible tasks that each can run. This doubles as both configuration and documentation.

lurkles:
  - ./app-a
  - ./app-b
  
  - name: app-c
    cwd: './app-c'
    tasks:
      test: echo "running test from $(pwd)"

  - name: app-d
    cwd: './app-d'
    tasks:
      test: echo "running test from $(pwd)"
  
tasks:
  test: run the test suites
  build: build the application

Then create a lurkle.yml file in each sub-folder. Each lurkle can then provide a command for as many tasks as they need.

# example/app-a/lurkle.yml
name: app-a
tasks:
  test: echo 'test from app-a'

# example/app-b/lurkle.yml
name: app-b
tasks:
  test: echo 'test from app-b'
  build: echo 'build from app-b'

Running Tasks

We can now run our commands from the example folder.

Running lurkle --help will list each command.

lurkle [tasks] [-l optional list of lurkle locations]
CommandResult
lurkleRun all commands in all lurkles
lurkle buildrun the build command in all lurkles
lurkle build testrun the build and test command in all lurkles
lurkle build -l src/services/micro-service-brun the build command in micro-service-b lurkle

Services

Lurkle provides a start command that serves as a wrapper around pm2. This allows you to coordinate ENV vars and choose which services you would like to start.

Configuring Services

Each key on sites creates a new service to start. The value object is passed directly to pm2 so any valid pm2 attribute is allowed. To minimise re-declaring environment variables the root env object will be used as defaults for each service.

services:
  env:
    CLIENT_HOST: 'localhost'
    CLIENT_PORT: 3000
    SERVER_HOST: 'localhost'
    SERVER_PORT: 3001

  server:
    env:
      SERVER_ONLY_ENV: 12345
    cwd: server
    script: 'index.js'

  client:
  server:
    cwd: client
    script: 'index.js'

Starting Services

lurkle start [sites]
CommandResult
lurkle startStart all sites
lurkle start clientStart only the client
lurkle start client serverStart the client and server
0.7.1

9 years ago

0.7.0

9 years ago

0.6.2

9 years ago

0.6.1

9 years ago

0.6.0

9 years ago

0.5.0

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago