It is recommended that you use the new publishing assistant mp-ci, no need to log in, and experience true one-click publishing.
WeChat mini program publishing assistant supports preview and upload. It can be used in conjunction with jenkins
to realize automated release of WeChat mini programs.
Because of api
adjustment, please select the correct mini-deploy
version according to the version number of the WeChat developer tools before installation.
Version | WeChat Developer Tools |
---|---|
2.x | 1.02.2004020 and above |
1.x | 1.02.2004020 or less |
// 全局安装
npm install -g mini-deploy
// 本地安装
npm install --save-dev mini-deploy
Usage: mini-deploy [--options ...]
Options:
-V, --version output the version number
-w, --workspace [value] 微信小程序工作区目录 (default: " /Users/neo/WorkSpace/deploy-mini " )
-ver, --ver [value] 发布版本号 (default: " 1.0.0 " )
-d, --desc [value] 发布简介 (default: " 2019年08月19日13点07分21秒提交上传" )
-m, --mode [value] 模式: preview | upload (default: " preview " )
--resume 启用任务续传 (default: true)
--no-resume 禁用任务续传
--upload.log [value] 上传日志路径
--preview.format [value] 二维码输出形式:terminal | base64 | image (default: " image " )
--preview.qr [value] 二维码存放路径 (default: " preview.png " )
--preview.log [value] 预览日志路径
--preview.compileCondition [value] 自定义编译条件
--login.format [value] 二维码输出形式:terminal | base64 | image (default: " terminal " )
--login.qr [value] 二维码存放路径
--login.log [value] 登录日志路径
-d, --debug debug mode
-h, --help output usage information
The result value is returned after executing the command:
mode
Preview ( preview
) or upload ( upload
).
During preview, the QR code
preview.png
will be generated in theworkspace
directory. The image can be read injenkins
and displayed in thejob
results. You can expand it by yourself.
workspace
Mini program project address, the command execution directory will be taken by default, and it will also check whether project.config.json
exists.
ver
Upload version number, default is 1.0.0
desc
Upload description, the default is 'Submit upload on xxxx year x month x day x o'clock x minute x second'
resume
After task resumption is enabled, the previous task will continue to be executed after logging in again during the upload or preview process.
no-resume
After disabling task resumption, you need to manually execute the task again after logging in again.
upload.log
After specifying, the additional information for this upload will be output to the specified path in json format, such as code package size and sub-package size information.
It should be noted that the log file needs to be created in advance.
preview.format
Preview the format of the QR code. Optional values for format include terminal (command line output), base64, and image.
preview.qr
QR code output position, relative to the project.
preview.log
After being determined, the additional information of this preview will be output to the specified path in json format, such as code package size and sub-package size information.
preview.compileCondition
Specify custom compilation conditions. The json condition can specify two fields. pathName represents the opened page, leaving it blank represents the homepage, and query represents the page parameters.
Examples are as follows:
{ "pathName" : " pages/index/index " , "query" : " x=1&y=2 " }
login.format
Same as preview.format
The default is terminal
, which will output the QR code to the stream. By viewing the console output in jenkins
, you can directly scan and log in.
If you have other needs, you can customize the output to a file.
login.qr
Same as preview.qr
login.log
Output login results to the specified file
changelog