@@ -5,271 +5,21 @@ stages:
55 - unit-tests
66 - build
77 - e2e-tests
8- - e2e_k8s_30
9- - e2e_k8s_31
10- - e2e_k8s_32
8+ - e2e_k8s
9+ - e2e_k8s_sch_1
10+ - e2e_k8s_sch_2
1111 - e2e_crd_versions
1212variables :
1313 KIND : v0.29.0
1414 DOCKER_HOST : tcp://docker:2375
1515 DOCKER_DRIVER : overlay2
1616 GO_VERSION : " 1.24"
1717 DOCKER_VERSION : " 28.1"
18- pipelines-check :
19- stage : bots
20- needs : []
21- image :
22- name : $CI_REGISTRY_GO/docker:$DOCKER_VERSION-go$GO_VERSION
23- entrypoint : [ "" ]
24- rules :
25- - if : $CI_PIPELINE_SOURCE == 'merge_request_event'
26- tags :
27- - go
28- script :
29- - go run cmd/gitlab-mr-pipelines/main.go
30- mr-backport-question :
31- stage : bots
32- needs : []
33- image :
34- name : $CI_REGISTRY_GO/docker:$DOCKER_VERSION-go$GO_VERSION
35- entrypoint : [ "" ]
36- rules :
37- - if : $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
38- tags :
39- - go
40- script :
41- - go run cmd/gitlab-mr-checker/main.go
42- diff :
43- stage : diff
44- rules :
45- - if : $CI_PIPELINE_SOURCE == 'merge_request_event'
46- - if : $CI_PIPELINE_SOURCE == 'push'
47- image :
48- name : $CI_REGISTRY_GO/golang:$GO_VERSION
49- entrypoint : [ "" ]
50- tags :
51- - go
52- before_script :
53- - make doc
54- script :
55- - test -z "$(git diff 2> /dev/null)" || exit "Documentation is not generated, issue \`make doc\` and commit the result"
56- - test -z "$(git ls-files --others --exclude-standard 2> /dev/null)" || exit "Documentation created untracked files, cannot proceed"
57- diff-crd :
58- stage : diff
59- rules :
60- - if : $CI_PIPELINE_SOURCE == 'merge_request_event'
61- - if : $CI_PIPELINE_SOURCE == 'push'
62- image :
63- name : $CI_REGISTRY_GO/golang:$GO_VERSION
64- entrypoint : [ "" ]
65- tags :
66- - go
67- before_script :
68- - go version
69- - make cr_generate
70- script :
71- - git diff
72- - test -z "$(git diff 2> /dev/null)" || exit "CRD generation was not generated, issue \`make cr_generate\` and commit the result"
73- - test -z "$(git ls-files --others --exclude-standard 2> /dev/null)" || exit "CRD generation created untracked files, cannot proceed"
74- tidy :
75- stage : lint
76- needs : []
77- rules :
78- - if : $CI_PIPELINE_SOURCE == 'merge_request_event'
79- - if : $CI_PIPELINE_SOURCE == 'push'
80- image :
81- name : $CI_REGISTRY_GO/golang:$GO_VERSION
82- entrypoint : [""]
83- tags :
84- - go
85- script :
86- - go mod tidy
87- - test -z "$(git diff 2> /dev/null)" || exit 'Go modules not tidied, issue \`go mod tidy\` and commit the result'
88- gofumpt :
89- stage : lint
90- needs : []
91- rules :
92- - if : $CI_PIPELINE_SOURCE == 'merge_request_event'
93- - if : $CI_PIPELINE_SOURCE == 'push'
94- image :
95- name : $CI_REGISTRY_GO/golang:$GO_VERSION
96- entrypoint : [""]
97- tags :
98- - go
99- script :
100- - make gofumpt
101- - test -z "$(git diff 2> /dev/null)" || exit 'Go code not formatted, issue \`make gofumpt\` and commit the result'
102- golangci_lint :
103- stage : lint
104- needs : []
105- rules :
106- - if : $CI_PIPELINE_SOURCE == 'merge_request_event'
107- - if : $CI_PIPELINE_SOURCE == 'push'
108- image :
109- name : $CI_REGISTRY_GO/golang:$GO_VERSION
110- entrypoint : [""]
111- tags :
112- - go
113- script :
114- - make lint-seq
115- commit-policy :
116- stage : lint
117- needs : []
118- rules :
119- - if : $CI_PIPELINE_SOURCE == 'merge_request_event'
120- image :
121- name : $CI_REGISTRY_GO/commit-check:5.2.0
122- entrypoint : [""]
123- tags :
124- - go
125- script :
126- - /check
127- unit-tests :
128- needs : ["diff", "tidy"]
129- rules :
130- - if : $CI_PIPELINE_SOURCE == 'merge_request_event'
131- - if : $CI_PIPELINE_SOURCE == 'push'
132- stage : unit-tests
133- image :
134- name : $CI_REGISTRY_GO/haproxy-alpine:3.1-go$GO_VERSION
135- entrypoint : [""]
136- tags :
137- - go
138- script :
139- - go build -v .
140- - go test -v ./...
141- docker-build :
142- stage : build
143- needs : []
144- rules :
145- - if : $CI_PIPELINE_SOURCE == 'merge_request_event'
146- - if : $CI_PIPELINE_SOURCE == 'push'
147- - if : $CI_PIPELINE_SOURCE == 'schedule'
148- image : $CI_REGISTRY_GO/docker:$DOCKER_VERSION-go$GO_VERSION
149- services :
150- - name : $CI_REGISTRY_GO/docker:$DOCKER_VERSION-dind
151- alias : docker
152- tags :
153- - go
154- before_script :
155- - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY_GO
156- - go version
157- - docker pull -q $CI_REGISTRY_GO/alpine:3
158- - docker image tag $CI_REGISTRY_GO/alpine:3 alpine:3
159- - docker pull -q $CI_REGISTRY_GO/golang:$GO_VERSION-alpine
160- - docker image tag $CI_REGISTRY_GO/golang:$GO_VERSION-alpine golang:$GO_VERSION-alpine
161- - sed -i "s~FROM golang~FROM $CI_REGISTRY_GO/golang~g" "build/Dockerfile"
162- - sed -i "s~FROM haproxytech/haproxy-alpine~FROM $CI_REGISTRY_GO/haproxy-alpine~g" "build/Dockerfile"
163- script :
164- - mkdir -p tar
165- - make build
166- - docker save -o tar/k8sIC.tar haproxytech/kubernetes-ingress:latest
167- artifacts :
168- when : on_success
169- paths :
170- - tar
171- expire_in : 60 minutes
172- .kind_deployment :
173- stage : e2e-tests
174- retry : 2
175- needs : ["diff", "tidy", "docker-build"]
176- rules :
177- - if : $CI_PIPELINE_SOURCE == 'merge_request_event'
178- - if : $CI_PIPELINE_SOURCE == 'push'
179- - if : $CI_PIPELINE_SOURCE == 'schedule'
180- image : $CI_REGISTRY_GO/docker:$DOCKER_VERSION-go$GO_VERSION
181- services :
182- - name : $CI_REGISTRY_GO/docker:$DOCKER_VERSION-dind
183- alias : docker
184- tags :
185- - go
186- artifacts :
187- paths :
188- - tar
189- expire_in : 1 minutes
190- exclude :
191- - tar/*
192- before_script :
193- - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY_GO
194- - docker load -i tar/k8sIC.tar
195- - go version
196- - go mod download &
197- # - docker pull -q $CI_REGISTRY_GO/alpine:3
198- # - docker image tag $CI_REGISTRY_GO/alpine:3 alpine:3
199- # - docker pull -q $CI_REGISTRY_GO/golang:$GO_VERSION-alpine
200- # - docker image tag $CI_REGISTRY_GO/golang:$GO_VERSION-alpine golang:$GO_VERSION-alpine
201- - docker pull -q $CI_REGISTRY_GO/haproxytech/http-echo:latest
202- - docker image tag $CI_REGISTRY_GO/haproxytech/http-echo:latest haproxytech/http-echo:latest
203- - docker pull -q $CI_REGISTRY_GO/haproxytech/proxy-protocol:latest
204- - docker image tag $CI_REGISTRY_GO/haproxytech/proxy-protocol:latest haproxytech/proxy-protocol:latest
205- - wget -nv -O /usr/local/bin/kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND}/kind-linux-amd64
206- - chmod +x /usr/local/bin/kind
207- - wget -nv -O /usr/local/bin/kubectl https://dl.k8s.io/release/${KUBECTL}/bin/linux/amd64/kubectl
208- - chmod +x /usr/local/bin/kubectl
209- - sed -i "s/K8S_VERSION/$K8S_VERSION/g" ".gitlab/kind-config.yaml"
210- - sed -i "s/KUBEADM_VER/$KUBEADM_VER/g" ".gitlab/kind-config.yaml"
211- - sed -i "s~CI_REGISTRY_GO~$CI_REGISTRY_GO~g" ".gitlab/kind-config.yaml"
212- - sed -i "s~FROM golang~FROM $CI_REGISTRY_GO/golang~g" "build/Dockerfile"
213- - sed -i "s~FROM haproxytech/haproxy-alpine~FROM $CI_REGISTRY_GO/haproxy-alpine~g" "build/Dockerfile"
214- - cat ./.gitlab/kind-config.yaml
215- - kind create cluster --name=dev --config=./.gitlab/kind-config.yaml
216- - sed -i -E -e "s/localhost|0\.0\.0\.0|127\.0\.0\.1/docker/g" "$HOME/.kube/config"
217- - sed -i -E -e "s/localhost|0\.0\.0\.0|127\.0\.0\.1/docker/g" "deploy/tests/e2e/client.go"
218- - until kubectl get nodes -o wide;do sleep 2; done
219- - kubectl get pods -A
220- after_script :
221- - kubectl get pods -A
222- - kind delete cluster --name=dev
223- parallel :
224- matrix :
225- - TEST_PART : ["parallel", "https", "sequential-1", "sequential-2"]
226- script :
227- - gotest --version
228- - CI_ENV=gitlab deploy/tests/create.sh
229- - kubectl get pods -A
230- - echo "running make -f Makefile.ci ci-e2e-$TEST_PART tests" && make -f Makefile.ci ci-e2e-$TEST_PART
231- .kind_deployment_schedules :
232- extends : .kind_deployment
233- allow_failure : true
234- e2e_k8s_30 :
235- stage : e2e_k8s_30
236- needs : ["docker-build"]
237- variables :
238- K8S_VERSION : v1.31.9
239- KUBEADM_VER : v1beta3
240- KUBECTL : v1.31.0
241- extends : .kind_deployment_schedules
242- rules :
243- - if : $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == 'weekly' && $SCHEDULE_DAY == 'monday'
244- e2e_k8s_31 :
245- stage : e2e_k8s_31
246- needs : ["docker-build"]
247- variables :
248- K8S_VERSION : v1.32.5
249- KUBEADM_VER : v1beta3
250- KUBECTL : v1.32.0
251- extends : .kind_deployment_schedules
252- rules :
253- - if : $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == 'weekly' && $SCHEDULE_DAY == 'tuesday'
254- e2e_crd_v1 :
255- stage : e2e_crd_versions
256- needs : ["docker-build"]
257- variables :
258- K8S_VERSION : v1.33.1
259- KUBEADM_VER : v1beta3
260- KUBECTL : v1.33.1
261- CRD_VERSION : v1
262- extends : .kind_deployment_schedules
263- rules :
264- - if : $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == 'weekly' && $SCHEDULE_DAY == 'wednesday'
265- e2e_k8s_32 :
266- stage : e2e_k8s_32
267- needs : ["docker-build"]
268- variables :
269- K8S_VERSION : v1.33.1
270- KUBEADM_VER : v1beta3
271- KUBECTL : v1.33.1
272- extends : .kind_deployment
273- rules :
274- - if : $CI_PIPELINE_SOURCE == 'merge_request_event'
275- - if : ' $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_NAMESPACE != "haproxy-controller"'
18+ include :
19+ - local : .gitlab/bots.yml
20+ - local : .gitlab/diff.yml
21+ - local : .gitlab/lint.yml
22+ - local : .gitlab/unit-tests.yml
23+ - local : .gitlab/build.yml
24+ - local : .gitlab/e2e_k8s.yml
25+ - local : .gitlab/e2e_k8s_crd_versions_scheduled.yml
0 commit comments