上传前端项目到CDN平台及自动刷新节点缓存的工具
- 下载对于平台可执行文件,放置到系统PATH目录下, 或
go get -u github.com/cnbattle/upcloud
- 根据使用的对象存储平台创建配置
.upcloud.env
文件, 具体参考下面示例
- 多线程上传
- 腾讯云
- 七牛云
- 阿里云
- UP_CLOUD_PLATFORM: 平台
- UP_CLOUD_PATH: 需上传静态资源路径
- UP_CLOUD_POOL_SIZE: 上传时的并发数,默认为10
- UP_CLOUD_PREFETCH_URLS: 上传完成,要刷新缓存的链接,VUE React等静态站点一般刷新首页index.html即可
UP_CLOUD_PLATFORM=tencent
UP_CLOUD_PATH=dist/
UP_CLOUD_POOL_SIZE=10
UP_CLOUD_PREFETCH_URLS=your prefetch urls (多个用,分割)
UP_CLOUD_SECRET_ID=your id
UP_CLOUD_SECRET_KEY=your key
UP_CLOUD_VISIT_NODE=your visis node
UP_CLOUD_PLATFORM=qiniu
UP_CLOUD_PATH=dist/
UP_CLOUD_POOL_SIZE=10
UP_CLOUD_PREFETCH_URLS=your prefetch urls (多个用,分割)
UP_CLOUD_ACCESS_KEY=your access key
UP_CLOUD_SECRET_KEY=your secret key
UP_CLOUD_BUCKET=your bucket
UP_CLOUD_PLATFORM=aliyun
UP_CLOUD_PATH=dist/
UP_CLOUD_POOL_SIZE=10
UP_CLOUD_PREFETCH_URLS=your prefetch urls (多个用,分割)
UP_CLOUD_ENDPOINT=your endpoint
UP_CLOUD_ACCESS_KEY_ID=your access key id
UP_CLOUD_ACCESS_KEY_SECRET=your access key secret
UP_CLOUD_BUCKET=your bucket