.drone.yml 2.5 KB

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