这是一个用于自动化部署 Rime 输入法方案的工具,支持通过 Docker 容器、直接运行脚本和 CNB 插件的方式来构建和打包 Rime 方案。
docker build -t rime-deploy .
docker run --rm -v $(pwd):/plugin rime-deploy \
--user-recipe-list "Mintimate/oh-my-rime:plum/full" \
--package-items "opencc lua build" \
--zip-file "oh-my-rime-online.zip"
确保系统已安装必要依赖:
# Ubuntu/Debian
sudo apt install -y librime-bin git zip
# 运行部署脚本
./build.sh --user-recipe-list "Mintimate/oh-my-rime:plum/full" --package-items "opencc lua build" --zip-file "oh-my-rime-online.zip"
支持在 CNB 流水线中作为插件使用:
- name: 自动打包在线方案包
image: docker.cnb.cool/mintimate/rime/deploy-schema
settings:
user_recipe_list: 'Mintimate/oh-my-rime:plum/full'
package_items: 'build opencc lua'
zip_file: oh-my-rime-online.zip
参考: oh-my-rime
| 参数 | 描述 | 默认值 |
|---|---|---|
--user-recipe-list | 用户方案列表(换行分隔) | 空 |
--shared-recipe-list | 共享方案列表(换行分隔) | 空 |
--schema-list | 方案列表(换行分隔) | 空 |
--package-items | 打包项目列表 | build |
--zip-file | 输出文件名 | oh-my-rime.zip |
-h, --help | 显示帮助信息 | - |
支持通过环境变量配置参数(自动注入 PLUGIN_ 前缀):
PLUGIN_USER_RECIPE_LISTPLUGIN_SHARED_RECIPE_LISTPLUGIN_SCHEMA_LISTPLUGIN_PACKAGE_ITEMSPLUGIN_ZIP_FILE. ├── Dockerfile # Docker 镜像构建文件 ├── build.sh # 主要的部署脚本 ├── .cnb.yml # CNB 配置文件 ├── LICENSE # 项目许可证文件 └── README.md # 项目说明文档
本项目采用 GPL-3.0 许可证。详见 LICENSE 文件。
脚本制作参考自: