.drone.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. kind: pipeline
  2. type: kubernetes
  3. name: book-webview
  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. JNLP_ENV: dev
  18. JNLP_REPLICAS: 2
  19. JNLP_TAG: v3.0.0
  20. JNLP_VERSION: v1 # default v1, v2 for canary
  21. DEPLOY_ENV: k8s-1 # 可以选择把应用部署到集群:k8s-1(阿里云) or k8s-2(IDC机房)
  22. JNLP_REPO: hub.evbj.easou.com
  23. JNLP_CONTAINER_PORT: 8080
  24. JNLP_INGRESS: nginx
  25. JNLP_SVC_MODE: http
  26. JNLP_STORAGE_CLASS: rbd #k8s-2的STORAGE_CLASS为: rbd; k8s-1的STORAGE_CLASS为: ceph-block
  27. JNLP_DOMAIN: .ieasou.cn
  28. JNLP_CONTROL: StatefulSet
  29. JNLP_STORAGE_CAPACITY: 200Gi
  30. JNLP_MOUNT_PATH: /data
  31. JNLP_LIVENESS_INIT: 45
  32. JNLP_LIVENESS_PER: 15
  33. JNLP_READINESS_INIT: 45
  34. JNLP_READINESS_PER: 15
  35. JNLP_INGRESS_PUB: yes
  36. commands:
  37. # 切换目标集群
  38. - kubecm s $DEPLOY_ENV
  39. # 生成配置YAML文件
  40. # - python3 /root/tools.py -b
  41. # 部署服务到kubernetes上
  42. - python3 /root/tools.py -a
  43. # 检查服务部署状态
  44. # - python3 /root/tools.py -c
  45. # 添加dns解析记录,生成访问域名
  46. - python3 /root/tools.py -d
  47. - name: success
  48. image: hub.evbj.easou.com/dev/drone-wechat:20200622
  49. settings:
  50. corpid: ww419ee4063735e1c0
  51. corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
  52. agent_id: 1000004
  53. title: "Pipeline ${DRONE_REPO_NAME} Success"
  54. description: "${DRONE_BUILD_LINK} 部署完成"
  55. msg_url: ${DRONE_BUILD_LINK}
  56. btn_txt: "否"
  57. when:
  58. status:
  59. - success
  60. - name: failure
  61. image: hub.evbj.easou.com/dev/drone-wechat:20200622
  62. settings:
  63. corpid: ww419ee4063735e1c0
  64. corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
  65. agent_id: 1000004
  66. title: "Pipeline ${DRONE_REPO_NAME} Failure"
  67. description: "${DRONE_BUILD_LINK} 部署失败,请检查配置!"
  68. msg_url: ${DRONE_BUILD_LINK}
  69. btn_txt: "否"
  70. when:
  71. status:
  72. - failure