logginghandler/.drone.yml

98 lines
1.5 KiB
YAML
Raw Permalink Normal View History

2020-10-13 15:26:40 +02:00
---
kind: pipeline
name: default
type: docker
golang-image: &golang-image golang:1.17-alpine
gobin-volume: &gobin-volume
name: gobin
path: /go/bin
usr-volume: &usr-volume
name: usr
path: /usr
deps-command: &deps-command apk add build-base git
2020-10-13 15:26:40 +02:00
steps:
- name: tags
2020-10-13 15:26:40 +02:00
image: alpine/git
commands:
- git fetch --tags
- name: install-tools
image: *golang-image
volumes:
- *gobin-volume
- *usr-volume
2020-10-13 15:26:40 +02:00
commands:
- *deps-command
- make install-tools
2020-10-13 15:26:40 +02:00
- name: lint
image: *golang-image
volumes:
- *gobin-volume
- *usr-volume
2020-10-13 15:26:40 +02:00
commands:
- make lint
depends_on:
- tags
- install-tools
- name: test
image: *golang-image
volumes:
- *gobin-volume
- *usr-volume
commands:
- make test
depends_on:
- install-tools
- tags
- lint
- name: build
image: *golang-image
volumes:
- *gobin-volume
- *usr-volume
commands:
- make build
depends_on:
- tags
- lint
- test
- install-tools
when:
event:
exclude:
- tag
2020-10-13 15:26:40 +02:00
- name: release
image: *golang-image
volumes:
- *gobin-volume
- *usr-volume
2020-10-13 15:26:40 +02:00
environment:
GITEA_TOKEN:
from_secret: gitea_token
commands:
- goreleaser release --rm-dist
2020-10-13 15:26:40 +02:00
depends_on:
- test
- lint
- tags
- install-tools
2020-10-13 15:26:40 +02:00
when:
event:
- tag
volumes:
- name: gobin
temp: {}
- name: usr
temp: {}