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.
 
 

38 lines
938 B

---
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
- name: docker-build
image: docker
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}
commands:
- docker ps
- name: rancher-push
image: registry.cn-hangzhou.aliyuncs.com/hvp/dpr:23 # 直接用busybox
settings:
docker_img : registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:${DRONE_BUILD_NUMBER}