.drone.yml 2.3 KB

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