本项目通过push触发cnb构建流程,通过命令行工具构建出Har包,并上传到cnb ohpm仓库
docker run --rm \
-v $(pwd):/workspace \
docker.cnb.cool/mayflyee/examples/harmony-command-line-tools:latest \
hvigorw assembleHar --no-daemon
# 进入交互模式
docker run --rm -it \
-e CNB_TOKEN=${CNB_TOKEN} \
-v $(pwd):/workspace \
docker.cnb.cool/mayflyee/examples/harmony-command-line-tools:latest \
bash
# 配置仓库,执行发布命令
ohpm config set publish_registry https://ohpm.cnb.cool/mayflyee/examples/ohpm/-/packages/
ohpm config set //ohpm.cnb.cool/mayflyee/examples/ohpm/-/packages/:_auth ${CNB_TOKEN}
ohpm publish <har_or_tgz_file>
https://cnb.cool/mayflyee/examples/harmony-command-line-tools