0.2.0 • Published 4 years ago

@slsplus/clii v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Serverless Plus CLI

npm NPM downloads Build Status semantic-release

CLI tool for Serverless Plus

Features

Usage

$ npm i @slsplus/cli -g
$ slsplus -h

Clone project

$ slsplus clone https://github.com/serverless-plus/cli

Parse serverless config file

$ slsplus parse -o -rv '{"src":"./"}'

Parse command will parse serverless config file with costomize and environment variables replacement.

For example, before is:

inputs:
  src:
    src: ./
    exclude:
      - .env
  region: ${env:REGION}
  apigatewayConf:
    protocols:
      - http
      - https

If process.env.REGION=ap-guangzhou, after parsing, the serverless.yml will be:

inputs:
  src: ./
  region: ap-guangzhou
  apigatewayConf:
    protocols:
      - http
      - https

Notice: if you don't pass -o option, serverless.yml will not be rewrite, the parse result will just be outputed to terminal.

Environment

For auto release action, you should setup GH_TOKEN and NPM_TOKEN secrets.

Development

All git commit mesage must follow below syntax:

type(scope?): subject  #scope is optional

support type:

  • feat: add new feature
  • fix: fix bug or patch feature
  • ci: CI
  • chore: modify config, nothing to do with production code
  • docs: create or modifiy documents
  • refactor: refactor project
  • revert: revert
  • test: test

Most of time, we just use feat and fix.

Test

For CI test, should copy .env.example to .env.test, then config below environment variables to yours:

TENCENT_SECRET_ID=xxx
TENCENT_SECRET_KEY=xxx
CODE_URL_COS=xxx

Notice: CODE_URL_COS is a cos url for project code download in CI environment.

License

MIT