1.0.26 • Published 1 year ago

ik-miniprogram-ci v1.0.26

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

介绍

ik-miniprogram-ci 是小程序打包、预览、上传工具,目前支持头条小程序、快手小程序、微信小程序。

注意事项

使用 ci 工具前需准备:

1、头条开发者账号绑定邮箱

2、快手和微信需生成上传代码密钥

3、项目根目录创建.ci-config.js 配置文件

安装

npm i ik-miniprogram-ci -D

使用

预览并发送钉钉群:miniprogram-ci preview

上传代码:miniprogram-ci publish

.ci-config.js 配置说明

完整配置示例

module.exports = {
  // 环境列表
  env: ['dev', 'prod'],
  // 小程序列表
  mp: ['guazi'],
  // 平台列表
  platforms: ['mp-weixin', 'mp-toutiao', 'mp-kuaishou'],
  // 二维码上传地址
  uploadConfig: {
    hostname: 'upload.xizhihk.com',
    path: '/upload/image?sufix=png',
  },
  // 钉钉通知配置
  dingtalks: {
    'mp-weixin': {
      secret:
        'xxx', // 钉钉机器人密钥
      accessToken:
        'xxx', // 钉钉机器人accessToken
    },
    'mp-toutiao': {
      secret:
        'xxx', // 钉钉机器人密钥
      accessToken:
        'xxx', // 钉钉机器人accessToken
    },
    'mp-kuaishou': {
      secret:
        'xxx', // 钉钉机器人密钥
      accessToken:
        'xxx', // 钉钉机器人accessToken
    },
  },
  /**
   * 获取发布配置
   * @param {环境} env
   * @param {小程序} mp
   * @param {平台} platform
   * @returns publishConfig
   * {
   *    appid: 小程序appid
   *    buildPath: 构建产物位置
   *    privateKeyPath: 微信或快手privateKey的位置,需要管理员在开发者平台生成
   * }
   */
  resolvePublishConfig(env, mp, platform) {
    return {
    	appid: 小程序appid
     	buildPath: 构建产物位置
      privateKeyPath: 微信或快手privateKey的位置,需要管理员在开发者平台生成
    };
  },
  // 自定义钉钉通知消息
  resolveNotifyMsg({
    env,
    description,
    mp,
    platform,
    publishResult,
    url,
    name,
    branchName,
  }) {
    return {
      title: 'xxx',
      text: 'xxx',
    };
  },
};

特殊配置项说明

resolvePublishConfig

获取发布配置

回调参数
参数说明
env环境
mp小程序
platform平台
函数返回值

函数必须返回一个对象,该对象包含以下字段

字段说明
appid小程序 appid
buildPath构建产物位置
privateKeyPath微信或快手 privateKey 的位置,需要管理员在开发者平台生成

resolveNotifyMsg

自定义钉钉通知消息

回调参数

函数接受参数为一个对象,该对象有以下字段

字段说明
env环境
mp小程序
platform平台
description用户在在命令行输入的描述
url二维码图片地址
publishResult发布结果对象,包含字段为 publishTime:String, expireTime: String
name操作人
branchName分支名
函数返回值

函数必须返回一个对象,该对象包含以下字段

字段说明
title钉钉消息标题
text钉钉消息内容,格式为 markdown
1.0.26

1 year ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago