ohpm-repo
此文檔記錄的是mac系統(tǒng)上單點(diǎn)部署私庫流程
一蹬刷、安裝
node 環(huán)境
-
下載 私庫工具包 下載中心
-
解壓 ohpm-repo 私倉工具包
將解壓出來的文件移動端你想存放的位置
-
將ohpm-repo工具包解壓目錄中bin目錄的路徑配置到系統(tǒng)環(huán)境變量path中
vim ~/.zshrc export PATH="<你的解壓路徑>/ohpm-repo-5.0.6.0/bin:$PATH" source ~/.zshrc
執(zhí)行命令 查詢版本
ohpm-repo -v 5.0.6
-
修改配置
conf/config.yaml
listen: <部署ohpm-repo機(jī)器的ip>:8088 ...
執(zhí)行安裝命令:
% ohpm-repo install
[2024-09-26T09:20:50.392] [WARN] default - "listen" protocol is set to 'http' in "config.yaml" file, which is insecure, advise to use the more secure 'https' protocol instead.
[2024-09-26T09:20:50.402] [INFO] default - initialize encryption component successfully.
[2024-09-26T09:20:50.402] [INFO] default - initialize "file database" successfully.
[2024-09-26T09:20:50.405] [INFO] default - initialize "file storage" successfully.
[2024-09-26T09:20:50.408] [INFO] console - install successfully.
[2024-09-26T09:20:50.408] [INFO] default - "deploy_root" environment variables: "OHPM_REPO_DEPLOY_ROOT = /Users/admin/ohpm-repo".
mac 會自動設(shè)置環(huán)境變量 export OHPM_REPO_DEPLOY_ROOT=/Users/wangwenjie/ohpm-repo
直接運(yùn)行 source ~/.zshrc
二泡态、啟動
% ohpm-repo start
[2024-09-26T09:21:09.058] [WARN] default - "listen" protocol is set to 'http' in "config.yaml" file, which is insecure, advise to use the more secure 'https' protocol instead.
[2024-09-26T09:21:09.059] [INFO] default - config file path: "/Users/admin/ohpm-repo/conf/config.yaml".
[2024-09-26T09:21:09.061] [INFO] default - initialize "file database" successfully.
[2024-09-26T09:21:09.061] [INFO] default - initialize "file storage" successfully.
[2024-09-26T09:21:09.068] [INFO] console - http address - <部署ohpm-repo機(jī)器的ip>:8088 - ohpm-repo/5.0.6.
至此 ohpm-repo 已經(jīng)成功的運(yùn)行到設(shè)備上了迂卢,在瀏覽器打開 http://<部署ohpm-repo機(jī)器的ip>:8088
ohpm-repo 首次啟動時而克,默認(rèn)創(chuàng)建一個管理員賬號,賬號名稱:admin腾降,密碼:12345Qq! 碎绎。該賬號在首次登錄時筋帖,需要修改其密碼,請修改密碼后寄啼,重新登錄該賬號赘淮。
三睦霎、從ohpm-repo獲取三方庫
- 為所有項(xiàng)目配置該私有庫
ohpm config set registry <配置的ohpm-repo私倉服務(wù)地址>/repos/ohpm ohpm install
- 或者使用 --register 從 ohpm 上安裝某一個庫
ohpm install @ohos/lottie --registry <配置的ohpm-repo私倉服務(wù)地址>/repos/ohpm
四梢卸、發(fā)布到 ohpm-repo
-
使用web頁面發(fā)布
用管理員賬號登錄ohpm-repo私倉管理地址,在個人中心 > 倉庫管理中副女,點(diǎn)擊管理三方包 > 上傳三方包蛤高,包的后綴名必須為 .har 或者 .tgz。
參考:
ohpm-repo私倉搭建工具