.drone.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. kind: pipeline
  2. type: kubernetes
  3. name: book-api
  4. clone:
  5. disable: true
  6. metadata:
  7. namespace: drone
  8. steps:
  9. - name: clone
  10. image: hub.evbj.easou.com/dev/alpine-git:20200622
  11. commands:
  12. - git clone --depth=1 $DRONE_GIT_HTTP_URL .
  13. - name: deployment
  14. image: hub.evbj.easou.com/dev/drone-agent:v3.0.1
  15. pull: always
  16. commands:
  17. # 切换目标集群
  18. - kubecm s $DEPLOY_ENV
  19. # 生成配置YAML文件
  20. - python3 /root/tools.py -b
  21. # 部署服务到kubernetes上
  22. - python3 /root/tools.py -a
  23. # 检查服务部署状态
  24. # - python3 /root/tools.py -c
  25. # 添加dns解析记录,生成访问域名
  26. - python3 /root/tools.py -d
  27. - name: success
  28. image: hub.evbj.easou.com/dev/drone-wechat:20200622
  29. settings:
  30. corpid: ww419ee4063735e1c0
  31. corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
  32. agent_id: 1000004
  33. title: "Pipeline ${DRONE_REPO_NAME} Success"
  34. description: "${DRONE_BUILD_LINK} 部署完成"
  35. msg_url: ${DRONE_BUILD_LINK}
  36. btn_txt: "否"
  37. when:
  38. status:
  39. - success
  40. - name: failure
  41. image: hub.evbj.easou.com/dev/drone-wechat:20200622
  42. settings:
  43. corpid: ww419ee4063735e1c0
  44. corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
  45. agent_id: 1000004
  46. title: "Pipeline ${DRONE_REPO_NAME} Failure"
  47. description: "${DRONE_BUILD_LINK} 部署失败,请检查配置!"
  48. msg_url: ${DRONE_BUILD_LINK}
  49. btn_txt: "否"
  50. when:
  51. status:
  52. - failure