|
@ -9,33 +9,30 @@ 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-push |
|
|
|
|
|
# image: plugins/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} |
|
|
|
|
|
|
|
|
# - name: golang-build |
|
|
|
|
|
# image: golang:1.17-alpine3.15 |
|
|
|
|
|
# volumes: |
|
|
|
|
|
# - name: gopath |
|
|
|
|
|
# path: /go |
|
|
# commands: |
|
|
# commands: |
|
|
## - docker build -t registry.cn-hangzhou.aliyuncs.com/hvp/dpr:7 . |
|
|
|
|
|
# - docker save -o registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:${DRONE_BUILD_NUMBER} |
|
|
|
|
|
|
|
|
# - 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: |
|
|
# when: |
|
|
# target: [ "" ] |
|
|
|
|
|
|
|
|
# target: [ "test","pre" ] |
|
|
|
|
|
|
|
|
|
|
|
- name: docker-push |
|
|
|
|
|
image: plugins/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} |
|
|
|
|
|
when: |
|
|
|
|
|
target: [ "test","pre"] |
|
|
|
|
|
|
|
|
- name: rancher-deploy |
|
|
- name: rancher-deploy |
|
|
image: registry.cn-hangzhou.aliyuncs.com/hvp/dpr:8 # 直接用busybox |
|
|
image: registry.cn-hangzhou.aliyuncs.com/hvp/dpr:8 # 直接用busybox |
|
|