forked from tinkerbell/smee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
82 lines (72 loc) · 1.62 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
quay_settings: &quay_settings
registry: quay.io
repo: quay.io/tinkerbell/boots
username:
from_secret: docker_username
password:
from_secret: docker_password
publish_tmpl: &publish_tmpl
image: plugins/docker
depends_on:
- build
- fmt
- lint
- test
quay_settings_pr: &quay_settings_pr
registry: quay.io
repo: quay.io/tinkerbell/boots-pr
username:
from_secret: public_docker_username
password:
from_secret: public_docker_password
kind: pipeline
type: docker
name: default
steps:
- name: lint
image: golangci/golangci-lint:v1.24.0
commands:
- golangci-lint run -v -D errcheck
- name: fmt
image: golang:1.13-alpine
commands:
- set -o pipefail
- apk add --update --upgrade --no-cache git
- go get golang.org/x/tools/cmd/goimports
- goimports -d . | (! grep .)
- name: test
image: golang:1.13-alpine
commands:
- CGO_ENABLED=0 go test -v ./...
- name: build
image: golang:1.13-alpine
commands:
- CGO_ENABLED=0 go build
- name: publish pr
<<: *publish_tmpl
settings:
<<: *quay_settings_pr
tags:
- pr${DRONE_PULL_REQUEST}
- pr${DRONE_PULL_REQUEST}-${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_SHA}
when:
event: pull_request
- name: publish master
<<: *publish_tmpl
settings:
<<: *quay_settings
tags:
- latest
- ${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_SHA}
when:
event: push
branch: master
- name: publish tag
<<: *publish_tmpl
settings:
<<: *quay_settings
tags:
- ${DRONE_TAG}
when:
event: tag