.drone.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. environment:
  17. DEPLOY_ENV: k8s-1
  18. commands:
  19. # 切换目标集群
  20. - kubecm s $DEPLOY_ENV
  21. # 生成配置YAML文件
  22. # - python3 /root/tools.py -b
  23. # 部署服务到kubernetes上
  24. - python3 /root/tools.py -a
  25. # 检查服务部署状态
  26. # - python3 /root/tools.py -c
  27. # 添加dns解析记录,生成访问域名
  28. - python3 /root/tools.py -d
  29. - name: success
  30. image: hub.evbj.easou.com/dev/drone-wechat:20200622
  31. settings:
  32. corpid: ww419ee4063735e1c0
  33. corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
  34. agent_id: 1000004
  35. title: "Pipeline ${DRONE_REPO_NAME} Success"
  36. description: "${DRONE_BUILD_LINK} 部署完成"
  37. msg_url: ${DRONE_BUILD_LINK}
  38. btn_txt: "否"
  39. when:
  40. status:
  41. - success
  42. - name: failure
  43. image: hub.evbj.easou.com/dev/drone-wechat:20200622
  44. settings:
  45. corpid: ww419ee4063735e1c0
  46. corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
  47. agent_id: 1000004
  48. title: "Pipeline ${DRONE_REPO_NAME} Failure"
  49. description: "${DRONE_BUILD_LINK} 部署失败,请检查配置!"
  50. msg_url: ${DRONE_BUILD_LINK}
  51. btn_txt: "否"
  52. when:
  53. status:
  54. - failure