forked from openshift-kni/performance-addon-operators
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
170 lines (150 loc) · 5.05 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
kind: pipeline
type: docker
name: release
workspace:
# This should align with WORKDIR of openshift-ci/Dockerfile.tools
path: /go/src/github.com/openshift-kni/performance-addon-operators
trigger:
ref:
include:
# Only release on tags with semver
# But glob pattern is a bit limited for this, and extended glob does not seem to work
# With this we will be fine for m.m.pp-bb[.pre], but we do not catch all invalid tags
- refs/tags/[0-9].[0-9].[0-9]-[0-9]*
- refs/tags/[0-9].[0-9].[0-9][0-9]-[0-9]*
- refs/tags/[0-9].[0-9].[0-9]-[0-9][0-9]*
- refs/tags/[0-9].[0-9].[0-9][0-9]-[0-9][0-9]*
steps:
- name: build-tools-image
image: plugins/docker
settings:
dockerfile: openshift-ci/Dockerfile.tools
username:
from_secret: QUAY_USER
password:
from_secret: QUAY_PASSWORD
registry: quay.io
# This only works if github user == quay user!
repo: quay.io/${DRONE_REPO_NAMESPACE}/performance-addon-operator-build-tools
tags:
- ${DRONE_TAG:-notset}
- name: build
image: quay.io/${DRONE_REPO_NAMESPACE}/performance-addon-operator-build-tools:${DRONE_TAG:-notset}
environment:
CSV_VERSION: ${DRONE_SEMVER_SHORT}
REGISTRY_NAMESPACE: ${DRONE_REPO_NAMESPACE}
IMAGE_TAG: ${DRONE_TAG}
commands:
- git fetch --tags # Needed for the release note
- TAG=${DRONE_TAG} make build generate-csv release-note generate-release-tags
- name: build-operator-image
image: plugins/docker
settings:
dockerfile: openshift-ci/Dockerfile.deploy
username:
from_secret: QUAY_USER
password:
from_secret: QUAY_PASSWORD
build_args:
- BIN_DIR=build/_output/bin/
- ASSETS_DIR=build/assets
registry: quay.io
# This only works if github user == quay user!
repo: quay.io/${DRONE_REPO_NAMESPACE}/performance-addon-operator
- name: validate-operator-imgage
image: quay.io/${DRONE_REPO_NAMESPACE}/performance-addon-operator:${DRONE_TAG:-notset}
commands:
- ls /usr/local/bin/performance-operator
- "/usr/local/bin/performance-operator 2>&1 | grep \"Operator Version: ${DRONE_TAG}\""
- "/usr/local/bin/performance-operator 2>&1 | grep \"Git Commit: ${DRONE_COMMIT}\""
- name: build-must-gather-image
image: plugins/docker
settings:
dockerfile: openshift-ci/Dockerfile.must-gather
username:
from_secret: QUAY_USER
password:
from_secret: QUAY_PASSWORD
build_args:
- COLLECTION_SCRIPTS_DIR=must-gather/collection-scripts
registry: quay.io
# This only works if github user == quay user!
repo: quay.io/${DRONE_REPO_NAMESPACE}/performance-addon-operator-must-gather
- name: validate-must-gather-image
image: quay.io/${DRONE_REPO_NAMESPACE}/performance-addon-operator-must-gather:${DRONE_TAG:-notset}
commands:
# This is simplistic, need to figure out something smarter
- grep performance /usr/bin/gather
- name: github-release
image: plugins/github-release
settings:
api_key:
from_secret: GITHUB_TOKEN
title: ${DRONE_TAG}
note: build/_output/release-note.md
files:
- build/_output/olm-catalog/performance-addon-operator/${DRONE_SEMVER_SHORT}/*
checksum:
- sha256
draft: false # Setting this to true does not assign the release note to a tag...
prerelease: true # So use prerelease
overwrite: false
when:
ref:
exclude:
# do not create github releases when the tag contains the word "test"
- refs/tags/*test*
---
# This pipeline builds the build tool image for each branch, so it does not need to be build for every PR update
# Builds based on changed files are supported by drone.io extensions only, which can't be installed on cloud.drone.io
# See https://github.com/drone/drone/issues/1021#issuecomment-596127812
kind: pipeline
type: docker
name: build-tools
trigger:
event:
include:
- push
branch:
include:
- master
- release-*
steps:
- name: build-tools-image
image: plugins/docker
settings:
dockerfile: openshift-ci/Dockerfile.tools
username:
from_secret: QUAY_USER
password:
from_secret: QUAY_PASSWORD
registry: quay.io
# This only works if github user == quay user!
repo: quay.io/${DRONE_REPO_NAMESPACE}/performance-addon-operator-build-tools
tags:
- ${DRONE_BRANCH:-notset}
---
# This pipeline runs unit tests and creates coverage reports for coveralls.io
kind: pipeline
type: docker
name: coverage
workspace:
# This should align with WORKDIR of openshift-ci/Dockerfile.tools
path: /go/src/github.com/openshift-kni/performance-addon-operators
trigger:
event:
include:
- push
- pull_request
branch:
include:
- master
- release-*
steps:
- name: coverage
image: quay.io/${DRONE_REPO_NAMESPACE}/performance-addon-operator-build-tools:${DRONE_BRANCH:-notset}
environment:
COVERALLS_TOKEN:
from_secret: COVERALLS_REPO_TOKEN
commands:
- make unittests