From e52c7c26effd2728642193cf3fbe66f168eb3600 Mon Sep 17 00:00:00 2001 From: "zhipeng.hu" Date: Sat, 27 Nov 2021 17:23:35 +0800 Subject: [PATCH] drone pull1 --- .drone.yml | 62 +++++++++++++++++++++++++++--------------------------- main.go | 2 +- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.drone.yml b/.drone.yml index 98888e5..a172098 100644 --- a/.drone.yml +++ b/.drone.yml @@ -9,30 +9,30 @@ volumes: path: /usr/local/path/gopath 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 # # drone-rancher插件,利用此插件来启动rancher @@ -46,13 +46,13 @@ steps: # # 为了使rancher能拉取到私有镜像, 需要在rancher控制面板"基础架构->镜像库"添加这个私有镜像库 # docker_image: registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:20 - - name: run - image: pelotech/drone-rancher - url: https://121.40.194.123:8443 - access_key: token-j24z5 - secret_key: fwbzktwzs4kqf8p4pzsfn92thzms76vrglghh2khmdxkr6svm57796 - service: default/test-drone - docker_image: registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:20 +# - name: run +# image: pelotech/drone-rancher +# url: https://121.40.194.123:8443 +# access_key: token-j24z5 +# secret_key: fwbzktwzs4kqf8p4pzsfn92thzms76vrglghh2khmdxkr6svm57796 +# service: default/test-drone +# docker_image: registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:20 # - name: rancher-deploy # image: peloton/drone-rancher diff --git a/main.go b/main.go index 187d016..d037315 100644 --- a/main.go +++ b/main.go @@ -12,7 +12,7 @@ func main() { r.GET("/", func(c *gin.Context) { // 通过请求上下文对象Context, 直接往客户端返回一个json c.JSON(200, gin.H{ - "message": "pong", + "message": "pong1", }) })