README.zh-CN.md 1.9 KB

egg-ci

NPM version build status Test coverage David deps npm download

自动生成持续集成配置文件

安装

$ npm i egg-ci --save-dev

用法

package.json 中添加如下配置:

"ci": {
  "type": "travis, appveyor", // 默认的集成环境是 'travis, appveyor',还支持 'github, azure-pipelines'
  "os": {
    "travis": "", // 支持 'linux, osx, windows' 三种操作系统,默认是 'linux'
    "azure-pipelines": "linux, windows, macos", // 支持 'linux, windows, macos' 三种操作系统,默认是 'linux, windows, macos'
    "github": "linux, windows, macos"
  },
  "npminstall": true, // 是否使用 `npminstall`, 默认为 true
  "version": "12, 14, 16", // 指定 Node 版本。 默认为 LTS 版本。
  // npm ci command
  "command": {
    "travis": "ci",
    "appveyor": "test",
    "azure-pipelines": "ci"
  },
  "services": "redis-server, mysql", // 自定义服务配置
  "license": false // 生成 license
}

原理

利用了 npm postinstall 的钩子,在每次执行 npm install 时生成 *.yml 配置文件。

License

MIT