从阿里云云效的制品库中同步文件到本地目录.目前只支持GENERIC类型的制品库.
go run aliyundevopssync.go -c config.json
{
"conf_dir": "/etc/aliyundevopssyncetc", // 配置文件目录,实际上是用来指定存储本地已经下载的文件的时戳,配置文件也可以放这里
"base_dir": "/usr/share/nginx/html/xxxx", // 本地下载目录
"api_domain": "openapi-rdc.aliyuncs.com", //云效api的域名, 参考 https://help.aliyun.com/zh/yunxiao/developer-reference/service-access-point-domain?spm=a2c4g.11186623.help-menu-150040.d_5_0_0.303dbe73oK0I6m
"token": "pt-xxxxx", //访问云效api的个人访问令牌, 参考 https://help.aliyun.com/zh/yunxiao/developer-reference/obtain-personal-access-token?spm=a2c4g.11186623.help-menu-150040.d_5_0_1.6c052d23RN2wbM
"org_id": "62xxxxxxx", // 云效组织ID,请前往组织管理后台的基本信息页面获取组织 ID
"repo_id": "repo-xxxx", // 云效仓库 ID,请前往制品库对应制品仓库的设置目录查看
"download_user_name": "62xxxxxxxx", // 云效制品库的用户名,在云效制品库, 全局设置里查看
"download_password": "xxxx", // 云效制品库的密码,在云效制品库, 全局设置里查看
"index_file_name": "xxx-latest.json", //xxxx-latest.json 的文件名, 可以自定义,对于这个文件下载后直接放在制品文件目录下,不会放在以各个版本号为名的子目录下.
"download_api_domain": "packages.aliyun.com" // 固定值, 云效制品库的下载链接里的域名
}
制品文件目录是指文件在制品库中指定的目录,比如:
https://packages.aliyun.com/api/protocol/xxxxxxxx/generic/repo-xxxx/files/a/b/c/output.tgz?version=1.2.3
这里的 a/b/c 就是制品文件目录.