.drone.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ---
  2. kind: pipeline
  3. name: book-touchrs-base
  4. steps:
  5. - name: build
  6. image: hub.evbj.easou.com/dev/drone-agent-custom:v6.0.0
  7. # pull: always
  8. privileged: true
  9. environment:
  10. JNLP_ENV: pro
  11. JNLP_REPLICAS: 5
  12. JNLP_TAG: v2.0.0
  13. JNLP_VERSION: v1 #default v1, canary for v2
  14. JNLP_REPO: hub.evbj.easou.com
  15. JNLP_CONTAINER_PORT: 8080
  16. JNLP_INGRESS: nginx
  17. JNLP_SVC_MODE: http
  18. JNLP_STORAGE_CLASS: rbd
  19. JNLP_DOMAIN: .ieasou.cn
  20. JNLP_CONTROL: StatefulSet
  21. JNLP_STORAGE_CAPACITY: 200Gi
  22. JNLP_MOUNT_PATH: /data
  23. JNLP_LIVENESS_INIT: 60
  24. JNLP_LIVENESS_PER: 10
  25. JNLP_READINESS_INIT: 60
  26. JNLP_READINESS_PER: 10
  27. commands:
  28. - wrapper.sh /bin/sh
  29. - docker --config /etc/docker build -t "$JNLP_REPO/$JNLP_ENV/$DRONE_REPO_NAME:$JNLP_TAG" . -f Dockerfile
  30. - docker --config /etc/docker push "$JNLP_REPO/$JNLP_ENV/$DRONE_REPO_NAME:$JNLP_TAG"
  31. # 生成配置YAML文件
  32. - python tools.py -b
  33. # 调用kubectl部署服务到kubernetes上
  34. - python tools.py -a
  35. # 检查服务部署状态
  36. - python tools.py -c
  37. # 添加dns解析记录,生成访问域名
  38. - python tools.py -d
  39. - name: success
  40. image: clem109/drone-wechat
  41. settings:
  42. corpid: ww419ee4063735e1c0
  43. corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
  44. agent_id: 1000004
  45. title: "Pipeline ${DRONE_REPO_NAME} Success"
  46. description: "${DRONE_BUILD_LINK} 部署完成"
  47. msg_url: ${DRONE_BUILD_LINK}
  48. btn_txt: "否"
  49. when:
  50. status:
  51. - success
  52. - name: failure
  53. image: clem109/drone-wechat
  54. settings:
  55. corpid: ww419ee4063735e1c0
  56. corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
  57. agent_id: 1000004
  58. title: "Pipeline ${DRONE_REPO_NAME} Failure"
  59. description: "${DRONE_BUILD_LINK} 部署失败,请检查配置!"
  60. msg_url: ${DRONE_BUILD_LINK}
  61. btn_txt: "否"
  62. when:
  63. status:
  64. - failure