2022-04-03 18:01:36 +08:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: compile
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: restore-pkg
|
|
|
|
image: drillster/drone-volume-cache
|
|
|
|
volumes:
|
2022-04-03 18:02:44 +08:00
|
|
|
- name: cache
|
|
|
|
path: /cache
|
2022-04-03 18:01:36 +08:00
|
|
|
settings:
|
|
|
|
restore: true
|
|
|
|
mount:
|
|
|
|
- $GOPATH/pkg
|
|
|
|
|
|
|
|
# - name: test
|
2022-04-03 19:20:23 +08:00
|
|
|
# image: eigeen/golang-devops:1.18-alpine
|
2022-04-03 18:01:36 +08:00
|
|
|
# commands:
|
|
|
|
# - go test
|
|
|
|
|
|
|
|
- name: build
|
2022-04-03 19:20:23 +08:00
|
|
|
image: eigeen/golang-devops:1.18-alpine
|
2022-04-03 18:01:36 +08:00
|
|
|
environments:
|
|
|
|
- CGO_ENABLED=0
|
|
|
|
commands:
|
|
|
|
- go build
|
|
|
|
|
|
|
|
- name: rebuild-pkg
|
|
|
|
image: drillster/drone-volume-cache
|
|
|
|
volumes:
|
2022-04-03 18:02:44 +08:00
|
|
|
- name: cache
|
|
|
|
path: /cache
|
2022-04-03 18:01:36 +08:00
|
|
|
settings:
|
|
|
|
rebuild: true
|
|
|
|
mount:
|
|
|
|
- $GOPATH/pkg
|
|
|
|
#当对应条件的时候才会执行
|
|
|
|
when:
|
|
|
|
status:
|
|
|
|
- success
|
|
|
|
- failure
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: cache
|
|
|
|
host:
|
|
|
|
path: /tmp/cache
|