|
|
|
@ -63,19 +63,6 @@ steps:
|
|
|
|
|
- echo "172.31.211.15 git.oa00.com" >> /etc/hosts
|
|
|
|
|
- git clone $DRONE_REMOTE_URL .
|
|
|
|
|
- git checkout $DRONE_COMMIT
|
|
|
|
|
- name: restore-cache
|
|
|
|
|
image: meltwater/drone-cache
|
|
|
|
|
settings:
|
|
|
|
|
backend: filesystem
|
|
|
|
|
restore: true
|
|
|
|
|
cache_key: "gomod"
|
|
|
|
|
archive_format: gzip
|
|
|
|
|
filesystem_cache_root: "/var/lib/cache"
|
|
|
|
|
mount:
|
|
|
|
|
- 'mod.pkg'
|
|
|
|
|
volumes:
|
|
|
|
|
- name: cache
|
|
|
|
|
path: "/var/lib/cache"
|
|
|
|
|
# Do stuff..
|
|
|
|
|
- name: build
|
|
|
|
|
image: golang:1.16-alpine3.13
|
|
|
|
@ -83,19 +70,6 @@ steps:
|
|
|
|
|
GOMODCACHE: '/drone/src/mod.pkg'
|
|
|
|
|
commands:
|
|
|
|
|
- GOPROXY=https://goproxy.cn GOSUMDB=off CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags "-X recook/configs.environment=debug" -tags=jsoniter -v -o ./bin/server ./main.go
|
|
|
|
|
- name: rebuild-cache
|
|
|
|
|
image: meltwater/drone-cache
|
|
|
|
|
settings:
|
|
|
|
|
backend: filesystem
|
|
|
|
|
rebuild: true
|
|
|
|
|
cache_key: "gomod"
|
|
|
|
|
archive_format: gzip
|
|
|
|
|
filesystem_cache_root: "/var/lib/cache"
|
|
|
|
|
mount:
|
|
|
|
|
- 'mod.pkg'
|
|
|
|
|
volumes:
|
|
|
|
|
- name: cache
|
|
|
|
|
path: "/var/lib/cache"
|
|
|
|
|
- name: docker
|
|
|
|
|
image: plugins/docker
|
|
|
|
|
settings:
|
|
|
|
@ -108,10 +82,6 @@ steps:
|
|
|
|
|
from_secret: docker_password
|
|
|
|
|
tags:
|
|
|
|
|
- latest
|
|
|
|
|
volumes:
|
|
|
|
|
- name: cache
|
|
|
|
|
host:
|
|
|
|
|
path: "/tmp/cache"
|
|
|
|
|
trigger:
|
|
|
|
|
branch:
|
|
|
|
|
- test
|
|
|
|
|