From fca1a23643a9c9a00189f70a93fcb380f4344b13 Mon Sep 17 00:00:00 2001 From: "zhipeng.hu" Date: Mon, 7 Aug 2023 16:37:21 +0800 Subject: [PATCH] docker --- .drone.yml | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/.drone.yml b/.drone.yml index 47ac2aa..0d8281c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -9,26 +9,26 @@ volumes: 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} + - 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} - name: rancher-push @@ -37,4 +37,6 @@ steps: settings: docker_img : registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:${DRONE_BUILD_NUMBER} commands: - - podman ps \ No newline at end of file + - podman ps + - podman pull registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:${DRONE_BUILD_NUMBER} + - podman save registry.cn-hangzhou.aliyuncs.com/huvipg/test-drone:${DRONE_BUILD_NUMBER} >test-drone-${DRONE_BUILD_NUMBER}.tar \ No newline at end of file