--- kind: pipeline type: docker name: default volumes: - name: gopath host: path: /usr/local/path/gopath steps: # - name: golang-build # image: golang:1.17-alpine3.15 # volumes: # - name: gopath # path: /go # commands: # - export GOPROXY=https://goproxy.cn # - go mod init test-drone # - go mod tidy # - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o test-drone # when: # target: [ "test","pre" ] # # - name: docker-build # image: plugins/docker # privileged: true # settings: # username: tjqmhu # password: tjqm4912 # repo: registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone # dockerfile: Dockerfile # registry: https://registry.cn-hangzhou.aliyuncs.com # tags: ${DRONE_BUILD_NUMBER} # when: # target: [ "test","pre" ] # - name: rancher-push # privileged: true # image: registry.cn-hangzhou.aliyuncs.com/hvp/dpr:55 # 直接用busybox # settings: ## docker_img : registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:${DRONE_BUILD_NUMBER} # tar : test-drone-${DRONE_BUILD_NUMBER}.tar # commands: # - podman ps # - docker login --username=tjqmhu -p "tjqm4912" registry.cn-hangzhou.aliyuncs.com # - docker pull registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:${DRONE_BUILD_NUMBER} # - docker save registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:${DRONE_BUILD_NUMBER} >test-drone-${DRONE_BUILD_NUMBER}.tar # when: # target: [ "test","pre" ] - name: rancher-deploy privileged: true image: registry.cn-hangzhou.aliyuncs.com/hvp/dpr:70 #直接用busybox settings: # tar : test-drone-${DRONE_BUILD_NUMBER}.tar docker_img: registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:113 # username: docker-push # password: WeWlh6hGYCtxO4r # registry: https://repository.241210.com username: tjqmhu password: tjqm4912 registry: https://registry.cn-hangzhou.aliyuncs.com # when: # target: [ "test","pre" ] commands: # - docker login --username=tjqmhu -p "tjqm4912" registry.cn-hangzhou.aliyuncs.com # - docker pull registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:113 # - docker save registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:113 >test-drone-${DRONE_BUILD_NUMBER}.tar - ls - dpr when: target: ["pre"]