https://github.com/bestburning/tencentcloud
用于刷新腾讯cdn
https://github.com/bestburning/tencentcloud
cdn coding refresh tencentcloud
Last synced: 3 months ago
JSON representation
用于刷新腾讯cdn
- Host: GitHub
- URL: https://github.com/bestburning/tencentcloud
- Owner: BestBurning
- License: mit
- Created: 2020-03-28T13:27:53.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-23T04:02:06.000Z (about 5 years ago)
- Last Synced: 2025-01-14T01:48:49.558Z (5 months ago)
- Topics: cdn, coding, refresh, tencentcloud
- Language: Java
- Homepage: https://di1shuai.com/%E8%85%BE%E8%AE%AF%E4%BA%91cdn%E5%88%B7%E6%96%B0.html
- Size: 33.2 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tencentcloud
在[e.coding.net](https://e.coding.net/)上用官方提供的[demo](https://codes-farm.coding.net/p/html-cos-demo/d/html-cos-demo/git)自动将`博客代码`推至**腾讯COS**
不过最后涉及云函数刷新CDN的地方,计费方式过于恐怖,所以用自己的方式去刷新CDN## 前置步骤
直到`刷新CDN`之前与[demo](https://codes-farm.coding.net/p/html-cos-demo/d/html-cos-demo/git)保持一致,
之后在`coding`->`项目`中`构建`设置中添加一步`刷新CDN`:
```
pipeline {
agent any
stages {
stage('检出') {
steps {
checkout([
$class: 'GitSCM',
branches: [[name: env.GIT_BUILD_REF]],
userRemoteConfigs: [[url: env.GIT_REPO_URL, credentialsId: env.CREDENTIALS_ID]]
])
}
}
stage('部署到腾讯云存储') {
steps {
echo '部署中...'
sh 'coscmd config -a $TENCENT_SECRET_ID -s $TENCENT_SECRET_KEY -b $TENCENT_BUCKET -r $TENCENT_REGION'
sh 'rm -rf .git'
sh 'coscmd upload -r ./ /'
echo '部署完成'
}
}
stage('刷新CDN') {
steps {
echo '准备刷新'
sh 'git clone https://github.com/BestBurning/tencentcloud.git'
dir(path: './tencentcloud') {
sh 'mvn clean package '
sh 'java -jar ./target/tencentcloud-1.0-SNAPSHOT.jar $TENCENT_SECRET_ID $TENCENT_SECRET_KEY $TENCENT_REGION https://di1shuai.com/'
}
echo '刷新完毕'
}
}
}
}
```
### 参数说明
```
java -jar ./target/tencentcloud-1.0-SNAPSHOT.jar $TENCENT_SECRET_ID $TENCENT_SECRET_KEY $TENCENT_REGION https://di1shuai.com/
```
1. 腾讯云`SECRET_ID`
2. 腾讯云`SECRET_KEY`
3. 区域
4. `>=4`的参数均为要刷新的`目录`