-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
101 lines (89 loc) · 1.83 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
101 lines (89 loc) · 1.83 KB
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
workflow:
rules:
- if: $CI_DEPLOY_FREEZE
when: never
- if: $CI_PIPELINE_SOURCE == 'push'
- if: $CI_PIPELINE_SOURCE == 'web'
- if: $CI_PIPELINE_SOURCE == 'schedule'
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'pipeline'
- if: $CI_PIPELINE_SOURCE == 'api'
when: never
- if: $CI_PIPELINE_SOURCE == 'trigger'
when: never
include:
- local: go.yaml
.run-on-push-to-default-branch:
rules:
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
.run-on-push-and-in-mr:
rules:
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
default:
image: golang:1.26.1
lint:
extends:
- .run-on-push-and-in-mr
script:
- go fmt .
audit:
extends:
- .run-on-push-and-in-mr
script:
- go vet .
unit_tests:
extends:
- .run-on-push-and-in-mr
- .unit-tests-go
build:
needs:
- lint
- audit
- unit_tests
extends:
- .run-on-push-and-in-mr
- .build-go
variables:
version: $CI_COMMIT_REF_NAME
test:
needs:
- build
extends:
- .run-on-push-and-in-mr
image: alpine
script:
- ./hello
deploy:
needs:
- build
- unit_tests
rules:
- if: '$CI_COMMIT_REF_NAME == "dev" || $CI_COMMIT_REF_NAME == "live"'
environment:
name: ${CI_COMMIT_REF_NAME}
image: curlimages/curl:8.21.0
script:
- |
curl https://seat${SEAT_INDEX}.${CI_COMMIT_REF_NAME}.webdav.inmylab.de/ \
--fail \
--verbose \
--upload-file hello \
--user seat${SEAT_INDEX}:${PASS}
pages:
needs:
- build
- unit_tests
extends:
- .run-on-push-to-default-branch
image: alpine
script:
- cp hello public/hello
artifacts:
paths:
- public
trigger:
extends:
- .run-on-push-to-default-branch
trigger:
include: child.yaml