# 依赖环境
# 安装hcloud https://support.huaweicloud.com/qs-hcli/hcli_02_003.html
# 安装obsutil https://support.huaweicloud.com/utiltg-obs/obs_11_0003.html

# 打包项目，携带应用前缀（index.html中相对路径将自动修复为/dev/crm前缀）
# yss-project 子项目名称
# /dev/ 项目测试版上传路径
# /dev/crm yss-project项目预留路径
ng build yss-project --base-href=/dev/yss/

# 清空旧文件目录
obsutil rm obs://nova-cloud/dev/yss -r -f -i=XSUWJSVMZNHLWFAINRZ1 -k=P4TyfwfDovVNqz08tI1IXoLWXyEOSTKJRVlsGcV6 -e="obs.cn-south-1.myhuaweicloud.com"

# 同步文件目录
obsutil sync ./dist/yss-project/browser obs://nova-cloud/dev/yss  -i=XSUWJSVMZNHLWFAINRZ1 -k=P4TyfwfDovVNqz08tI1IXoLWXyEOSTKJRVlsGcV6 -e="obs.cn-south-1.myhuaweicloud.com" -acl=public-read

# 授权公开可读
obsutil chattri obs://nova-cloud/dev/yss -r -f -i=XSUWJSVMZNHLWFAINRZ1 -k=P4TyfwfDovVNqz08tI1IXoLWXyEOSTKJRVlsGcV6 -e="obs.cn-south-1.myhuaweicloud.com" -acl=public-read

hcloud CDN CreateRefreshTasks/v2 --cli-region="cn-north-1" --refresh_task.urls.1="https://app.fmode.cn/dev/coach/" --refresh_task.type="directory" --cli-access-key=2BFF7JWXAIJ0UGNJ0OSB --cli-secret-key=NaPCiJCGmD3nklCzX65s8mSK1Py13ueyhgepa0s1
