auto前端工具箱
1. 安装
$ yarn global add ssh://git@10.0.3.254:autoh5/atbfftools.git$ at-bff-tools --helpUsage: at-bff-tools [options] [command]Options:-V, --version output the version number-h, --help output usage informationCommands:init|i [options] Geneate the targe resourcesdeploy|d [options] Deploy to test env
2. 使用
命令
init
$ at-bff-tools init --helpUsage: init|i [options]Geneate the targe resourcesOptions:-t, --type <init type> what type u wanna init (default: ["ci"])-h, --help output usage information
使用参数 -t
指明所要初始化的资源类型
包括:
- compose => docker compose生成外部依赖(暂时只包含mongo redis)
- ci => 生成node服务的.gitlab-ci.yml的模版
- ci:custom => 自定义生成.gitlab-ci.yml
- framework:egg => 生成一个初始化的egg应用(代理了egg-init)
- server => 生成完整server项目(包含常用插件安装及eslint, 不包含ci/cd和docker compose)
- jenkins => 为当前应用生成一个jenkins项目(无法手动发送, 需要配合ci模版进行使用)
- lint:js => 为项目生成JavaScript规则的lint
- lint:ts => 为项目生成Typescript规则的lint
deploy
$ at-bff-tools deploy --helpUsage: deploy|d [options]Deploy to test envOptions:-t, --type <build type> what type u wanna deploy (default: ["normal"])-p, --port <build port> which port u wanna deploy-h, --help output usage information
参数 -t
表明所发布模版类型,暂时只支持默认模版
-p
表示服务运行的端口
deploy命令同样依赖gitlab ci, 需使用应再 .git-ci.yml中加入, 推荐使用init命令生成的ci模版进行无缝连接
before_script:- yarn global add ssh://git@10.0.3.254:autoh5/atbfftools.gitdeploy_test1:varibles:TEST_BUILD_ENV: test1script:- at-bff-tools deploy -p 12345