Browse Source

cache

master
cobb 4 years ago
parent
commit
6edb87d0ce
  1. 8
      .drone.yml

8
.drone.yml

@ -16,13 +16,12 @@ steps:
restore: true restore: true
cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}'
archive_format: "gzip" archive_format: "gzip"
filesystem_cache_root: "/tmp/repotest"
mount: mount:
- pkg.mod - pkg.mod
- pkg.build - pkg.build
volumes: volumes:
- name: cache - name: cache
path: /tmp/repotest
path: /go
# golang 编译 # golang 编译
- name: build - name: build
@ -38,7 +37,7 @@ steps:
- go build -ldflags "-w -s" -o tmp/carp main.go - go build -ldflags "-w -s" -o tmp/carp main.go
volumes: volumes:
- name: cache - name: cache
path: /tmp/repotest
path: /go
when: when:
event: event:
- push - push
@ -53,13 +52,12 @@ steps:
rebuild: true rebuild: true
cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}'
archive_format: "gzip" archive_format: "gzip"
filesystem_cache_root: "/tmp/repotest"
mount: mount:
- pkg.mod - pkg.mod
- pkg.build - pkg.build
volumes: volumes:
- name: cache - name: cache
path: /tmp/repotest
path: /go
# 发布,编译镜像并推送到私有镜像仓库 # 发布,编译镜像并推送到私有镜像仓库
- name: publish - name: publish

Loading…
Cancel
Save