1.2.2 • Published 10 months ago

usf-cli v1.2.2

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

Develop UOS Func Stateless with usf-cli

Install usf-cli

npm install -g usf-cli

Create project

mkdir stateless-function
cd stateless-function

Init project

usf-cli -i 
# or
npm init

Creat function

# create default function
usf-cli -c --f=helloWorld
# or create function with crud template
usf-cli -c --f=helloCrud --t=crud_mysql

Edit function & event data

vim ./helloWorld/index.js
# or open it in IDE
vim ./.uos_test/helloWorld_event.json
# or open it in IDE

Install Dependency (If necessary)

npm install .

Run function locally

# with default event data json(./uos_test/helloWorld_event.json)
usf-cli -r --f=helloWorld
# or with specified event data json(e.g. you have created a test.json in your project dir)
usf-cli -r --f=helloWorld --e=./test.json

Deploy function

# before delpoying function, you should set app id and service secret for this project (used for generating auth token)
usf-cli -a --id=<app-id> --secret=<service-secret>
# and then you can deploy it
usf-cli -d
# Func Stateless also support install dependency online, so that if the size of your project is larger than 50MB, you can set 'installDenpendency'
usf-cli -d --installDependency

CI Script

# test usf-cli with ci script (shell)
vim @usf-cli/ci.sh  # set APPID & APPSECRET
chmod +x @usf-cli/ci.sh 
@usf-cli/ci.sh
1.2.2

10 months ago

1.2.0

11 months ago

1.1.3

11 months ago