Browse Source

drone 自动提交

master
zhipeng.hu 3 years ago
parent
commit
f4d14a7bad
  1. 55
      .drone.yml

55
.drone.yml

@ -9,35 +9,38 @@ volumes:
path: /usr/local/path/gopath path: /usr/local/path/gopath
steps: steps:
# - name: golang-build
# image: golang
# 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: [ "" ]
#
# - 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: [ "" ]
- name: golang-build
image: golang
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: [ "" ]
- 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: [ "" ]
- name: rancher-deploy - name: rancher-deploy
image: registry.cn-hangzhou.aliyuncs.com/hvp/dpr:2 # 直接用busybox
image: registry.cn-hangzhou.aliyuncs.com/hvp/dpr:4 # 直接用busybox
settings: settings:
pname: huvipg
url: https://121.40.194.123:8443/v3/
env: test
pname: test-drone
docker-img : registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:${DRONE_BUILD_NUMBER}
# #
# - name: deploy-prod # - name: deploy-prod
# image: repository.241210.com/repository/base/kubectl:4 # image: repository.241210.com/repository/base/kubectl:4

Loading…
Cancel
Save