.drone.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. kind: pipeline
  2. type: kubernetes
  3. name: avatar-web
  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 $DRONE_GIT_HTTP_URL .
  13. - name: deployment
  14. image: hub.evbj.easou.com/dev/drone-agent:v3.0.1-241127 #hub.evbj.easou.com/dev/drone-agent:v3.0.1-230721
  15. pull: always
  16. # privileged: true
  17. environment:
  18. JNLP_ENV: pro #datagroup-qa OR datagroup-pro
  19. JNLP_ACTIVE_PROFILE: product #test OR pro
  20. JNLP_TAG: v0.0.5
  21. JNLP_REPLICAS: 2
  22. JNLP_JAVA_OPTS: -XX:PermSize=512M -XX:MaxPermSize=512M -Xms2048M -Xmx2048M
  23. JNLP_VERSION: v1 # default v1, v2 for canary
  24. DEPLOY_ENV: k8s-2 # 可以选择把应用部署到集群:k8s-1(Aliyun) or k8s-2(JiNan
  25. JNLP_REPO: hub.evbj.easou.com
  26. JNLP_CONTAINER_PORT: 8080
  27. JNLP_INGRESS: nginx
  28. JNLP_SVC_MODE: http
  29. JNLP_STORAGE_CLASS: rbd
  30. JNLP_DOMAIN: .ieasou.cn
  31. JNLP_CONTROL: StatefulSet
  32. JNLP_STORAGE_CAPACITY: 10Gi
  33. JNLP_MOUNT_PATH: /data
  34. JNLP_LIVENESS_INIT: 20
  35. JNLP_LIVENESS_PER: 5
  36. JNLP_READINESS_INIT: 30
  37. JNLP_READINESS_PER: 5
  38. JNLP_INGRESS_PUB: no
  39. commands:
  40. # 切换目标集群
  41. - kubecm s $DEPLOY_ENV
  42. # 生成配置YAML文件
  43. - python3 /root/tools.py -b
  44. # 部署服务到kubernetes上
  45. - python3 /root/tools.py -a
  46. # 检查服务部署状态
  47. # - python3 /root/tools.py -c
  48. # 添加dns解析记录,生成访问域名1
  49. #- python3 /root/tools.py -d
  50. - name: success
  51. image: hub.evbj.easou.com/dev/drone-wechat:20200622
  52. settings:
  53. corpid: ww419ee4063735e1c0
  54. corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
  55. agent_id: 1000004
  56. title: "Pipeline ${DRONE_REPO_NAME} Success"
  57. description: "${DRONE_BUILD_LINK} 部署完成"
  58. msg_url: ${DRONE_BUILD_LINK}
  59. btn_txt: "否"
  60. when:
  61. status:
  62. - success
  63. - name: failure
  64. image: hub.evbj.easou.com/dev/drone-wechat:20200622
  65. settings:
  66. corpid: ww419ee4063735e1c0
  67. corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
  68. agent_id: 1000004
  69. title: "Pipeline ${DRONE_REPO_NAME} Failure"
  70. description: "${DRONE_BUILD_LINK} 部署失败,请检查配置!"
  71. msg_url: ${DRONE_BUILD_LINK}
  72. btn_txt: "否"
  73. when:
  74. status:
  75. - failure