Browse Source

docker

master
zhipeng.hu 1 year ago
parent
commit
14373ec61b
  1. 58
      .drone.yml

58
.drone.yml

@ -9,31 +9,31 @@ volumes:
path: /usr/local/path/gopath path: /usr/local/path/gopath
steps: 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: 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 # - name: rancher-push
@ -53,13 +53,13 @@ steps:
privileged: true privileged: true
image: registry.cn-hangzhou.aliyuncs.com/hvp/dpr:60 # 直接用busybox image: registry.cn-hangzhou.aliyuncs.com/hvp/dpr:60 # 直接用busybox
settings: settings:
docker_img: registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:${DRONE_BUILD_NUMBER}
docker_img: registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:113
# username: docker-push # username: docker-push
# password: WeWlh6hGYCtxO4r # password: WeWlh6hGYCtxO4r
# registry: https://repository.241210.com # registry: https://repository.241210.com
# username: tjqmhu
# password: tjqm4912
# registry: https://registry.cn-hangzhou.aliyuncs.com
username: tjqmhu
password: tjqm4912
registry: https://registry.cn-hangzhou.aliyuncs.com
when: when:
target: [ "test","pre" ] target: [ "test","pre" ]
Loading…
Cancel
Save