.drone.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. kind: pipeline
  2. name: default
  3. steps:
  4. - name: 生成 html,部署web,国内 cdn 加速访问
  5. image: cnlym/maven:3-jdk-11-alpine-aliyun
  6. volumes:
  7. - name: mvnCache
  8. path: /root/.m2
  9. - name: htmlDir
  10. path: /htmlDir
  11. commands:
  12. # 生成html
  13. - mvn clean generate-resources -B -V
  14. # 加备案号
  15. - find target/shoulder-specs/ -type f -name "*.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>#g'
  16. # 国内访问加速: 替换 css、js 为国内七牛云 cdn 地址
  17. - find target/shoulder-specs/ -type f -name "*.html" | xargs sed -i 's#cdnjs.cloudflare.com/ajax/libs#cdn.staticfile.org#g'
  18. # 国内访问加速: 替换 google 字体地址为 其他的
  19. - find target/shoulder-specs/ -type f -name "*.html" | xargs sed -i 's#fonts.googleapis.com#fonts.cat.net#g'
  20. #- sed -i "s!cdnjs.cloudflare.com/ajax/libs!cdn.staticfile.org!g" `grep cdnjs.cloudflare -rl target/shoulder-specs/`
  21. # 搬运到web目录(目前不会删除历史文档,只有更新)
  22. - cp -r target/shoulder-specs/* /htmlDir
  23. - name: 钉钉通知
  24. image: guoxudongdocker/drone-dingtalk
  25. settings:
  26. token: 5f6c32b36e771df227b1ccb8898325158e12d851ae61982d1ec225a1aa58e251
  27. type: markdown
  28. volumes:
  29. - name: mvnCache
  30. host:
  31. path: /tmp/cache/.m2
  32. - name: htmlDir
  33. host:
  34. path: /opt/web/shoulderSpecsDocx
  35. trigger:
  36. branch:
  37. - master
  38. event:
  39. - push