forked from hetznercloud/hcloud-cloud-controller-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
122 lines (106 loc) · 2.19 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
---
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
- 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.16
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
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.19:
<<: *testk8se2e
variables:
K8S_VERSION: k8s-1.19.10
k8s-1.19 networks:
<<: *testk8se2e
variables:
K8S_VERSION: k8s-1.19.10
USE_NETWORKS: "yes"
k8s-1.20:
<<: *testk8se2e
variables:
K8S_VERSION: k8s-1.20.6
k8s-1.20 networks:
<<: *testk8se2e
variables:
K8S_VERSION: k8s-1.20.6
USE_NETWORKS: "yes"
k8s-1.21:
<<: *testk8se2e
variables:
K8S_VERSION: k8s-1.21.0
k8s-1.21 networks:
<<: *testk8se2e
variables:
K8S_VERSION: k8s-1.21.0
USE_NETWORKS: "yes"
release:image:
stage: release:image