forked from hetznercloud/hcloud-cloud-controller-manager
-
Notifications
You must be signed in to change notification settings - Fork 7
/
.gitlab-ci.yml
92 lines (81 loc) · 1.97 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
---
include:
- project: cloud/integrations/ci
file: default.yml
- project: cloud/backend/deploy-tools
file: ci/build/image.yml
- project: cloud/backend/deploy-tools
file: ci/release/image.yml
stages:
- test
- build
- build:image
- e2e-test
- release
- release:image
variables:
GOPROXY: goproxy.prodext.hcinfra.de
GONOSUMDB: hetzner.cloud
test:lint:
stage: test
image: golangci/golangci-lint:v1.54.2
allow_failure: true
script:
- golangci-lint run -v
except:
- tags
- main
test:unit:
stage: test
image: golang:1.21
variables:
NODE_NAME: "test"
script:
- go test $(go list ./... | grep -v e2e) -v
.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_v1/hcloud-cloud-controller-manager hcloud-cloud-controller-manager
artifacts:
paths:
- hcloud-cloud-controller-manager
expire_in: 1 day
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:
stage: e2e-test
image: docker:git
variables:
CCM_IMAGE_NAME: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
parallel:
matrix:
- K8S_VERSION: [k8s-1.24.10, k8s-1.25.6, k8s-1.26.1]
USE_NETWORKS: ["yes", "no"]
- K8S_VERSION: [k3s-v1.24.10+k3s1, k3s-v1.25.6+k3s1, k3s-v1.26.1+k3s1]
USE_NETWORKS: ["yes", "no"]
before_script:
- apk add --no-cache git make musl-dev go openssh-client
# Make pre-built docker image available
- docker login $CI_REGISTRY --username=$CI_REGISTRY_USER --password=$CI_REGISTRY_PASSWORD
- docker pull $CCM_IMAGE_NAME
script:
- go test $(go list ./... | grep e2e) -v -timeout 60m
release:image:
stage: release:image