.drone.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. ---
  2. kind: pipeline
  3. type: kubernetes
  4. name: mainsearch
  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://tfstj46s.mirror.aliyuncs.com
  21. registry: hub.evbj.easou.com
  22. repo: hub.evbj.easou.com/mainsearch/${DRONE_REPO_NAME}
  23. tag: v1.0.5
  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: mainsearch
  30. JNLP_REPLICAS: 2
  31. JNLP_TAG: v1.0.5
  32. JNLP_VERSION: v1 # default v1, v2 for canary
  33. DEPLOY_ENV: k8s-1 # 可以选择把应用部署到集群:k8s-1 or k8s-2
  34. JNLP_REPO: hub.evbj.easou.com
  35. JNLP_CONTAINER_PORT: 7000
  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. JNLP_INGRESS_PUB: yes
  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