.drone.yml 1.9 KB

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