You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.7 KiB

3 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. ---
  2. kind: pipeline
  3. type: docker
  4. name: default
  5. volumes:
  6. - name: gopath
  7. host:
  8. path: /usr/local/path/gopath
  9. steps:
  10. - name: golang-build
  11. image: golang:1.17-alpine3.15
  12. volumes:
  13. - name: gopath
  14. path: /go
  15. commands:
  16. - export GOPROXY=https://goproxy.cn
  17. - go mod init test-drone
  18. - go mod tidy
  19. - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o test-drone
  20. - name: docker-build
  21. image: plugins/docker
  22. settings:
  23. username: tjqmhu
  24. password: tjqm4912
  25. repo: registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone
  26. dockerfile: Dockerfile
  27. registry: https://registry.cn-hangzhou.aliyuncs.com
  28. tags: ${DRONE_BUILD_NUMBER}
  29. # - name: rancher-push
  30. # privileged: true
  31. # image: registry.cn-hangzhou.aliyuncs.com/hvp/dpr:34 # 直接用busybox
  32. # settings:
  33. # docker_img : registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:${DRONE_BUILD_NUMBER}
  34. # commands:
  35. # - podman ps
  36. # - docker login --username=tjqmhu -p "tjqm4912" registry.cn-hangzhou.aliyuncs.com
  37. # - docker pull registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:${DRONE_BUILD_NUMBER}
  38. # - docker save registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:${DRONE_BUILD_NUMBER} >test-drone-${DRONE_BUILD_NUMBER}.tar
  39. - name: rancher-deploy
  40. privileged: true
  41. image: registry.cn-hangzhou.aliyuncs.com/hvp/dpr:52 # 直接用busybox
  42. settings:
  43. docker_img: registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:${DRONE_BUILD_NUMBER}
  44. # username: docker-push
  45. # password: WeWlh6hGYCtxO4r
  46. # registry: https://repository.241210.com
  47. username: tjqmhu
  48. password: tjqm4912
  49. registry: https://registry.cn-hangzhou.aliyuncs.com