-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
145 lines (128 loc) · 3.28 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
image: registry.opensuse.org/opensuse/infrastructure/containers/heroes-salt-testing:latest
stages:
- test
- deploy
.test_mr:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_BRANCH == 'production'
.test_common:
extends:
- .test_mr
stage: test
tags:
- docker
.test_artifacts:
artifacts:
when: always
paths:
- '*.txt'
lint:
extends:
- .test_common
image: registry.opensuse.org/opensuse/infrastructure/containers_tumbleweed/heroes-salt-validation:latest
script:
- bin/set_gitlab_ci_safe_directory.sh
- bin/lint.sh
validate:
extends:
- .test_common
image: registry.opensuse.org/opensuse/infrastructure/containers_tumbleweed/heroes-salt-validation:latest
script:
- bin/set_gitlab_ci_safe_directory.sh
- bin/test_validate.sh
show_highstate:
extends:
- .test_common
- .test_artifacts
before_script:
- bin/prepare_test_env.sh -g -s
script: bin/test_show_highstate.sh
test_haproxy:
extends:
- .test_common
- .test_artifacts
image: registry.opensuse.org/opensuse/infrastructure/containers/heroes-salt-testing-haproxy:latest
before_script:
- bin/prepare_test_env.sh -g -s -n
- bin/replace_secrets.sh
script: bin/test_haproxy.sh
# changes:
# - bin/test_haproxy.sh
# - pillar/cluster/*/*
# - pillar/common/haproxy/*
# - salt/profile/proxy/*
# - salt/role/proxy*
test_nftables:
extends:
- .test_common
image: registry.opensuse.org/opensuse/infrastructure/containers/heroes-salt-testing-nftables:latest
script: bin/test_nftables.pl
artifacts:
when: always
paths:
- salt/files_rendered/nftables/
test_networks:
extends:
- .test_common
image: registry.opensuse.org/opensuse/infrastructure/containers/heroes-salt-testing-networks:latest
script: bin/test_networks.pl
needs:
- job: test_nftables
test_prometheus:
extends:
- .test_common
image: registry.opensuse.org/opensuse/infrastructure/containers/heroes-salt-testing-prometheus:latest
before_script: bin/prepare_test_env.sh -s -n
script: bin/test_prometheus.sh
artifacts:
when: always
paths:
- '*.txt'
- rules/*.txt
# Dynamically generated jobs
prepare_includes:
extends:
- .test_mr
script: bin/render_gitlab_ci_includes.py -w
artifacts:
paths:
- .gitlab-ci.includes/*.yml
test_highstate:
extends:
- .test_mr
needs:
- prepare_includes
trigger:
include:
- artifact: .gitlab-ci.includes/test_highstate.yml
job: prepare_includes
strategy: depend
test_nginx:
extends:
- .test_mr
needs:
- prepare_includes
trigger:
include:
- artifact: .gitlab-ci.includes/test_nginx.yml
job: prepare_includes
strategy: depend
.deploy:
rules:
- if: $CI_COMMIT_BRANCH == 'production'
stage: deploy
tags:
- docker
sync:
extends: .deploy
image: registry.opensuse.org/opensuse/infrastructure/containers/heroes-salt-deployment-rsync:latest
script: bin/sync.sh
resource_group: production
#deploy:
# extends: .deploy
# image: registry.opensuse.org/opensuse/infrastructure/containers_tumbleweed/heroes-salt-deployment:latest
# needs:
# - sync
# script:
# - bin/set_gitlab_ci_safe_directory.sh
# - bin/deploy.py --mode test --no-mine-update --state-verbose=False