leo-cli

3.0.2 • Public • Published

LeoPlatform/cli

leo-cli

The Leo command line interface

After installaction: Quick Start Guide: https://github.com/LeoPlatform/Leo

Overview of the Leo Platform: https://docs.leoplatform.io

Installation

Pre-Requisites

  1. Install the aws-cli toolkit - Instructions for this are found at http://docs.aws.amazon.com/cli/latest/userguide/installing.html
  2. Configure the aws-cli tools - Instructions are found at http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
  3. Install node - https://nodejs.org/en/
  4. Deploy the Leo Bus Cloudformation

Install

  1. Install using npm. In your project folder run the following command.
npm install leo-cli -g

leo-cli create

Create a System

A system provides you the opportunity to create a cohesive group of microservices. It is not required, but gives you a moment to consider the overall structure of your project. The leo-cli create commands will create a directory.

leo-cli create system MySystem
cd MySystem

Create a Microservice

A microservice is the central architectural construct

leo-cli create microservice MyService
cd MyService

Create a REST API

Microservice exposed via REST.

leo-cli create resource MyAPI
cd MyAPI

Create a React Application

A front-end application. Also considered a microservice

leo-cli create react MyReactApp
cd MyReactApp

Additional tools for Leo front-end applications:

LEO Authentication - Helps provide cognito authenticated api calls

LEO Authorization - A Front-end Authorization framework that is modeled after AWS Permission structure

Front End Specific Configuration - Configure AWS Cognito for Front End apps

Build Bots

Bots must be created inside a microservice directory

cd /MySystem/MyService
leo-cli create load MyLoadBot
leo-cli create enrich MyEnrichBot
leo-cli create offload MyOffloadBot
leo-cli create bot MyBot
leo-cli create cron MyCronBot

Testing Bots

Inside a bot directory

cd /MySystem/MyService/bots/MyBot
leo-cli test .

Runing Bots

Inside a bot or resource directory

cd /MySystem/MyService/bots/MyBot
leo-cli run .

leo-cli publish - Publishing Microservices & Bots

Publishing a microservice will build all needed lambda functions into zip files and a cloudformation file. Those files are then uploaded to your publish s3 bucket.

The publish command must be run from a micorservice or bot directory

leo-cli publish
Note:

As of version 2.0.0, leo_cli_config.js and leo_config.js are required to be able to publish. See leo-config for config details. Config files are automatically created as part of the Quick Start.

options

  • -e --env [environment] Environment.
  • --changeset Only build Changeset.
  • -c Only build cloudformation.
  • -s Save cloudformation.json to the microservice directory.
  • -F --force-deploy Force-deploy without requiring confirmation of changeset.
  • -d --deploy [environment] Deploy the published cloudformation.
  • -f all --force all Force publish and deploy of all bots, including ones without changes.
  • --filter idGlobExp Filters the lambdas deployed by the given glob expression. default: *
  • --run awsStackName Runs the generated cloudformation.json against the AWS Stack 'awsStackName'. If the stack doesn't exist, it will be crated
  • --build Builds the cloudformation and lambdas but doesn't publish them to s3
  • --public Makes the s3 publish folder public

Version of the build using the microservice or bot package.json file. If a bot is forced to be built and has the same version number the current timestamp will be appended to he version

Deploy Examples

Publish a Microservice with all new/updated bots

cd /MySystem/MyService
leo-cli publish 

Publish a Microservice and force all bots to build

cd /MySystem/MyService
leo-cli publish --force all

Publish a single bot in a Microservice

cd /MySystem/MyService/bots/MyBot
leo-cli publish

Publish a single bot or resource in a Microservice

cd /MySystem/MyService/bots/MyBot
leo-cli publish 
cd /MySystem/MyService
leo-cli publish --filter MyBot

Deploying a Microservices to AWS

The deploy command can only be run after a microservice has been published. You must be inside a microservice directory to deploy.

The second parameter is the name of the AWS Stack for the microservice.

cd /MySystem/MyService
leo-cli deploy . TestMyService
leo-cli deploy . StageMyService
leo-cli deploy . ProdMyService

Support

Want to hire an expert, or need technical support? Reach out to the Leo team: https://leoinsights.com/contact

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.0.27latest
3.0.3-beta1beta
2.6.21rc
2.2.0-138-g2ec34501alpha

Version History

VersionDownloads (Last 7 Days)Published
3.0.3-beta1
3.0.27
3.0.11
3.0.01
2.6.21
2.6.11
2.6.01
2.5.31
2.5.22
2.5.11
2.5.01
2.4.12
2.4.01
2.3.61
2.3.51
2.3.41
2.3.31
2.3.21
2.3.12
2.3.01
2.2.11
2.2.0-138-g2ec34501
2.2.0-136-g5914c901
2.2.0-135-g1ce83d31
2.2.0-134-g5b118a81
2.2.0-133-gfe7da9d1
2.2.0-132-ga6e319a1
2.2.01
2.1.61
2.1.5-121-g546951c1
2.1.51
2.1.41
2.1.31
2.1.21
2.1.11
2.1.01
2.0.21
2.0.11
2.0.01
1.0.301
1.0.3-0.rc11
1.0.291
1.0.281
1.0.271
1.0.261
1.0.251
1.0.241
1.0.231
1.0.221
1.0.201
1.0.191
1.0.181
1.0.171
1.0.161
1.0.151
1.0.141
1.0.131
1.0.121
1.0.111
1.0.101
1.0.91
1.0.81
1.0.71
1.0.61
1.0.51
1.0.41
1.0.31
1.0.21
1.0.11
1.0.01

Package Sidebar

Install

npm i leo-cli

Weekly Downloads

79

Version

3.0.2

License

MIT

Unpacked Size

319 kB

Total Files

129

Last publish

Collaborators

  • leoinsights
  • jgrantr
  • czirker
  • elsmob
  • jhunsaker
  • zirkerc
  • francislewis