.drone.yml 985 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. kind: pipeline
  2. type: docker
  3. name: 自动部署
  4. clone:
  5. disable: false # 禁用自带clone
  6. workspace:
  7. path: /drone/src
  8. steps:
  9. - name: 镜像打包
  10. pull: if-not-exists
  11. image: plugins/docker
  12. settings:
  13. #dockerfile: Dockerfile
  14. repo: harbor.sxidc.com/fs/${DRONE_REPO_NAME//_/-}
  15. registry: harbor.sxidc.com
  16. tags: ${DRONE_COMMIT_BRANCH/master/latest}-${DRONE_BUILD_NUMBER}
  17. username:
  18. from_secret: harbor_username
  19. password:
  20. from_secret: harbor_password
  21. # 使用ssh访问主机制作镜像并运行
  22. - name: 集群部署
  23. pull: if-not-exists
  24. image: bh90210/dron8s:latest
  25. settings:
  26. repo_namespace: ywzx
  27. repo_name: ${DRONE_REPO_NAME//_/-}
  28. yaml: ./deployment-app.yaml
  29. image_addr: harbor.sxidc.com/fs/${DRONE_REPO_NAME//_/-}:${DRONE_COMMIT_BRANCH/master/latest}-${DRONE_BUILD_NUMBER}
  30. kubeconfig:
  31. from_secret: test_kubeconfig
  32. trigger:
  33. branch:
  34. - main