.drone.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. kind: pipeline
  2. type: kubernetes
  3. name: copyright-content-manager-api
  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: build
  14. image: plugins/docker
  15. settings:
  16. username: admin
  17. password: Easou2)1*
  18. insecure: true
  19. mirror: https://tfstj46s.mirror.aliyuncs.com
  20. registry: hub.evbj.easou.com
  21. repo: hub.evbj.easou.com/pro/${DRONE_REPO_NAME}
  22. tag: v1.0.1
  23. - name: deployment
  24. image: hub.evbj.easou.com/dev/drone-agent:v3.0.1-230721
  25. pull: always
  26. # privileged: true
  27. environment:
  28. JNLP_ENV: pro
  29. JNLP_REPLICAS: 1
  30. JNLP_TAG: v1.0.1
  31. JNLP_VERSION: v1 # default v1, v2 for canary
  32. DEPLOY_ENV: k8s-4 # 可以选择把应用部署到集群:k8s-1(阿里云) or k8s-2(青岛IDC机房)or k8s-4(济南IDC机房)
  33. JNLP_REPO: hub.evbj.easou.com
  34. JNLP_CONTAINER_PORT: 8080
  35. JNLP_INGRESS: nginx
  36. JNLP_SVC_MODE: http
  37. JNLP_STORAGE_CLASS: rbd
  38. JNLP_DOMAIN: .ieasou.cn
  39. JNLP_CONTROL: StatefulSet
  40. JNLP_STORAGE_CAPACITY: 200Gi
  41. JNLP_MOUNT_PATH: /data
  42. JNLP_LIVENESS_INIT: 90
  43. JNLP_LIVENESS_PER: 15
  44. JNLP_READINESS_INIT: 90
  45. JNLP_READINESS_PER: 15
  46. JNLP_INGRESS_PUB: yes
  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