.drone.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. kind: pipeline
  2. type: kubernetes
  3. name: eavideo-admin
  4. clone:
  5. disable: true
  6. metadata:
  7. namespace: ci
  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: build
  14. image: plugins/docker
  15. settings:
  16. username: admin
  17. password: Easou2)1*
  18. insecure: true
  19. custom_dns: 223.5.5.5
  20. mirror: https://ci7pm4nx.mirror.aliyuncs.com
  21. registry: hub.evbj.easou.com
  22. repo: hub.evbj.easou.com/rec/${DRONE_REPO_NAME}
  23. tag: v1.0.7
  24. - name: deployment
  25. image: hub.evbj.easou.com/dev/drone-agent:v3.0.1-230721
  26. pull: always
  27. # privileged: true
  28. environment:
  29. JNLP_ENV: rec
  30. JNLP_REPLICAS: 1
  31. JNLP_TAG: v1.0.7
  32. JNLP_VERSION: v1 # default v1, v2 for canary
  33. DEPLOY_ENV: k8s-4 # 可以选择把应用部署到集群:k8s-1 or k8s-2 or k8s-4
  34. JNLP_REPO: hub.evbj.easou.com
  35. JNLP_CONTAINER_PORT: 6005
  36. JNLP_INGRESS: nginx
  37. JNLP_SVC_MODE: http
  38. JNLP_STORAGE_CLASS: rbd
  39. JNLP_DOMAIN: .ieasou.cn
  40. JNLP_CONTROL: Deployment
  41. JNLP_STORAGE_CAPACITY: 1Gi
  42. JNLP_MOUNT_PATH: /data
  43. JNLP_LIVENESS_INIT: 30
  44. JNLP_LIVENESS_PER: 15
  45. JNLP_READINESS_INIT: 30
  46. JNLP_READINESS_PER: 15
  47. JNLP_INGRESS_PUB: no
  48. commands:
  49. # 切换目标集群
  50. - kubecm s $DEPLOY_ENV
  51. # 生成配置YAML文件
  52. - python3 /root/tools.py -b
  53. # 部署服务到kubernetes上
  54. - python3 /root/tools.py -a
  55. # 检查服务部署状态
  56. #- python3 /root/tools.py -c
  57. # 添加dns解析记录,生成访问域名
  58. # - python3 /root/tools.py -d
  59. - name: success
  60. image: hub.evbj.easou.com/dev/drone-wechat:20200622
  61. settings:
  62. corpid: ww419ee4063735e1c0
  63. corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
  64. agent_id: 1000004
  65. title: "Pipeline ${DRONE_REPO_NAME} Success"
  66. description: "${DRONE_BUILD_LINK} 部署完成"
  67. msg_url: ${DRONE_BUILD_LINK}
  68. btn_txt: "否"
  69. when:
  70. status:
  71. - success
  72. - name: failure
  73. image: hub.evbj.easou.com/dev/drone-wechat:20200622
  74. settings:
  75. corpid: ww419ee4063735e1c0
  76. corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
  77. agent_id: 1000004
  78. title: "Pipeline ${DRONE_REPO_NAME} Failure"
  79. description: "${DRONE_BUILD_LINK} 部署失败,请检查配置!"
  80. msg_url: ${DRONE_BUILD_LINK}
  81. btn_txt: "否"
  82. when:
  83. status:
  84. - failure