saxo-cli
v1.0.5
Published
saxo-cli 适用于Saxo 2b
Downloads
2
Readme
Intro
saxo-cli 适用于Saxo 2b
Install
$ npm install saxo-cli
Usage
deploy
saxo-cli -d 构建docker镜像,并重新部署rancher服务
- 配置package.json添加如下配置
saxo: {
deploy: {
"exe": "docker执行文件的路径 如 C:\\Program Files\\Docker Desktop.exe 非必填",
"AccessKey": "rancher 的 AccessKey",
"SecretKey": "rancher 的 SecretKey",
"name": "镜像名称",
"namespace": "镜像所在命名空间",
"version": "版本号",
"url": "rancher上复制的url 如 https://rancher.com/p/xxxx/workload/deployment:namespace:webapp",
"dockerfile": " dockerfile的名称 默认【Dockerfile】",
}
}
或者
saxo: {
deploy: {
"exe": "docker执行文件的路径 如 C:\\Program Files\\Docker Desktop.exe 非必填",
"AccessKey": "rancher 的 AccessKey",
"SecretKey": "rancher 的 SecretKey",
"works": {
"dev": {
"name": "dev镜像名称",
"namespace": "dev镜像所在命名空间",
"version": "dev版本号",
"url": "rancher上复制的url 如 https://rancher.com/p/xxxx/workload/deployment:namespace:webapp",
"dockerfile": " dockerfile的名称 默认【Dockerfile】",
},
"prod": {
"name": "prod镜像名称",
"namespace": "prod镜像所在命名空间",
"version": "prod版本号",
"url": "rancher上复制的url 如 https://rancher.com/p/xxxx/workload/production:namespace:webapp",
"dockerfile": " dockerfile的名称 默认【Dockerfile】",
}
}
}
}
- 根目录添加 dockerfile
- 运行saxo-cli -d
swagger
saxo-cli --swagger url to typescript api
- 配置 package.json 或者添加saxo.config.js
saxo: {
"swagger": {
typeFormat:{},
responseFormat: {},
output: {
path: '',
apiBefore: '',
},
}
}
typeFormat // custom type formatter ,Object or function(type: string): string ==> interface xxx
typeFormat: {
"integer": "number"
}
typeFormat: function(type) {
return type === 1 ? 'COLOR' : 'SIZE'
}
responseFormat // custom response formatter ,Object or function(type: string): string ==> Promise<xxx>
responseFormat: {
"integer": "number"
}
responseFormat: function(type) {
return type === 'object' ? Promise<Record<string, string>> : 'any'
}
output: {
path: // output path ,default is ./api
apiBefore: 'import * from xxx' // insert custom content into api file. default is null
}
$ saxo-cli --swagger http://xxx.xxx.com/v2/api-doc (swagger api-docs url)