12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- kind: pipeline
- name: default
- steps:
- - name: 生成 html,部署web,国内 cdn 加速访问
- image: cnlym/maven:3-jdk-11-alpine-aliyun
- volumes:
- - name: mvnCache
- path: /root/.m2
- - name: htmlDir
- path: /htmlDir
- commands:
- # 生成html
- - export _start_time_x=`date +%s`
- - mvn clean generate-resources -B -V
- - echo "【生成HTML cost="$((`date +%s` - $_start_time_x))"s"
- # 加备案号
- - export _start_time_x=`date +%s`
- - find target/shoulder-specs/ -type f -name "index.html" | xargs sed -i 's#<div id="footer-text">#<div id="footer-text"><a href="https://beian.miit.gov.cn/" target="_blank">鲁ICP备20024731号-1</a></br>#g'
- - echo "【加备案号 cost="$((`date +%s` - $_start_time_x))"s"
- # 国内访问加速: 替换 css、js 为国内七牛云 cdn 地址
- - export _start_time_x=`date +%s`
- - find target/shoulder-specs/ -type f -name "*.html" | xargs sed -i 's#cdnjs.cloudflare.com/ajax/libs#cdn.staticfile.org#g'
- - echo "【替换css cost="$((`date +%s` - $_start_time_x))"s"
- # 国内访问加速: 替换 google 字体地址为 其他的
- - export _start_time_x=`date +%s`
- - find target/shoulder-specs/ -type f -name "*.html" | xargs sed -i 's#fonts.googleapis.com#fonts.cat.net#g'
- - echo "【替换字体 cost="$((`date +%s` - $_start_time_x))"s"
- #- sed -i "s!cdnjs.cloudflare.com/ajax/libs!cdn.staticfile.org!g" `grep cdnjs.cloudflare -rl target/shoulder-specs/`
- # 搬运到web目录(目前不会删除历史文档,只有更新)
- - export _start_time_x=`date +%s`
- - cp -r target/shoulder-specs/* /htmlDir
- - echo "【搬运HTML cost="$((`date +%s` - $_start_time_x))"s"
-
- - name: 钉钉通知
- image: guoxudongdocker/drone-dingtalk
- settings:
- token: 5f6c32b36e771df227b1ccb8898325158e12d851ae61982d1ec225a1aa58e251
- type: markdown
-
-
- volumes:
- - name: mvnCache
- host:
- path: /tmp/cache/.m2
-
- - name: htmlDir
- host:
- path: /opt/web/shoulderSpecsDoc
- trigger:
- branch:
- - master
- event:
- - push
|