This repository has been archived by the owner on Apr 3, 2024. It is now read-only.
forked from hetznercloud/hcloud-cloud-controller-manager
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
184 lines (161 loc) · 3.47 KB
/
.gitlab-ci.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
---
include:
- project: "hc/backend/deploy-tools"
file: "ci/build/image.yml"
- project: "hc/backend/deploy-tools"
file: "ci/release/image.yml"
stages:
- test
- build
- build:image
- e2e-test
- e2e-test-k8s
- e2e-test-k8s-networks
- e2e-test-k3s
- e2e-test-k3s-networks
- release
- release:image
variables:
GOPROXY: goproxy.prodext.hcinfra.de
GONOSUMDB: hetzner.cloud
test:lint:
stage: test
image: golangci/golangci-lint:v1.27.0
allow_failure: true
script:
- golangci-lint run -v
except:
- tags
- master
tags:
- hc-bladerunner
test:unit:
stage: test
image: golang:1.17
variables:
NODE_NAME: "test"
script:
- go test $(go list ./... | grep -v e2etests) -v
tags:
- hc-bladerunner
.build:goreleaser: &build-goreleaser
stage: build
image:
name: goreleaser/goreleaser
entrypoint: [""]
variables:
GIT_DEPTH: 0
after_script:
- cp dist/hcloud-cloud-controller-manager_linux_amd64/hcloud-cloud-controller-manager hcloud-cloud-controller-manager
artifacts:
paths:
- hcloud-cloud-controller-manager
expire_in: 1 day
tags:
- hc-bladerunner
build:goreleaser:snapshot:
<<: *build-goreleaser
script: |
goreleaser build --rm-dist --snapshot
except:
- tags
build:goreleaser:tags:
<<: *build-goreleaser
script: |
goreleaser build --rm-dist
only:
- tags
build:image:
stage: build:image
.e2e:k8s: &testk8se2e
stage: e2e-test
image: docker:git
variables:
K8S_VERSION: k8s-1.19.10
CCM_IMAGE_NAME: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
before_script:
- apk add --no-cache git make musl-dev go openssh-client
script:
- go test $(go list ./... | grep e2etests) -v -timeout 60m
tags:
- hc-bladerunner-build
k8s-1.20:
<<: *testk8se2e
stage: e2e-test-k8s
variables:
K8S_VERSION: k8s-1.20.12
k8s-1.20-networks:
<<: *testk8se2e
stage: e2e-test-k8s-networks
variables:
K8S_VERSION: k8s-1.20.12
USE_NETWORKS: "yes"
k8s-1.21:
<<: *testk8se2e
stage: e2e-test-k8s
variables:
K8S_VERSION: k8s-1.21.6
k8s-1.21-networks:
<<: *testk8se2e
stage: e2e-test-k8s-networks
variables:
K8S_VERSION: k8s-1.21.6
USE_NETWORKS: "yes"
k8s-1.22:
<<: *testk8se2e
stage: e2e-test-k8s
variables:
K8S_VERSION: k8s-1.22.3
k8s-1.22-networks:
<<: *testk8se2e
stage: e2e-test-k8s-networks
variables:
K8S_VERSION: k8s-1.22.3
USE_NETWORKS: "yes"
.e2e:k3s: &testk3se2e
stage: e2e-test
image: docker:git
variables:
K8S_VERSION: k3s-1.20.12+k3s1
CCM_IMAGE_NAME: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
before_script:
- apk add --no-cache git make musl-dev go openssh-client
script:
- go test $(go list ./... | grep e2etests) -v -timeout 60m
tags:
- hc-bladerunner-build
k3s-1.20:
<<: *testk3se2e
stage: e2e-test-k3s
variables:
K8S_VERSION: k3s-1.20.12+k3s1
k3s-1.20-networks:
<<: *testk3se2e
stage: e2e-test-k3s-networks
variables:
K8S_VERSION: k3s-1.20.12+k3s1
USE_NETWORKS: "yes"
k3s-1.21:
<<: *testk3se2e
stage: e2e-test-k3s
variables:
K8S_VERSION: k3s-1.21.6+k3s1
k3s-1.21-networks:
<<: *testk3se2e
stage: e2e-test-k3s-networks
variables:
K8S_VERSION: k3s-1.21.6+k3s1
USE_NETWORKS: "yes"
k3s-1.22:
<<: *testk3se2e
stage: e2e-test-k3s
variables:
K8S_VERSION: k3s-1.22.3+k3s1
k3s-1.22-networks:
<<: *testk3se2e
stage: e2e-test-k3s-networks
variables:
K8S_VERSION: k3s-1.22.3+k3s1
USE_NETWORKS: "yes"
release:image:
stage: release:image