3.0.2 • Published 1 year ago

leo-cli v3.0.2

Weekly downloads
77
License
MIT
Repository
github
Last release
1 year ago

LeoPlatform/cli

Leo CLI

A Nodejs interface to interact with the Leo SDK and AWS

Documentation: https://docs.leoplatform.io

How to install the Leo CLI

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/

Install CLI

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

How to use the Leo CLI

Create a System

A system is the root directory for a group of microservices & bots. This command will create a directory for the system.

leo-cli create system MySystem

Create a Microservice

Microservices must be created inside a system directory

cd /MySystem
leo-cli create microservice MyService

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 .

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 .

options

  • --region awsRegion Sets the AWS Region. default: us-west-2
  • --filter idGlobExp Filters the lambdas deployed by the given glob expression. default: *
  • --force botId|all Forces a bot to build even if the versions are the same (Must be included in --filter expression). default: false
  • --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
3.0.3-beta

1 year ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.6.2

5 years ago

2.6.1

5 years ago

2.6.0

5 years ago

2.5.3

5 years ago

2.5.2

6 years ago

2.5.1

6 years ago

2.5.0

6 years ago

2.4.1

6 years ago

2.4.0

6 years ago

2.3.6

6 years ago

2.3.5

6 years ago

2.3.4

6 years ago

2.3.3

6 years ago

2.3.2

6 years ago

2.3.1

6 years ago

2.3.0

6 years ago

2.2.1

6 years ago

2.2.0

6 years ago

2.1.6

6 years ago

2.1.5

6 years ago

2.1.4

6 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.30

6 years ago

1.0.3-0.rc1

6 years ago

1.0.29

6 years ago

1.0.28

6 years ago

1.0.27

6 years ago

1.0.26

6 years ago

1.0.25

6 years ago

1.0.24

6 years ago

1.0.23

6 years ago

1.0.22

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago