-
Notifications
You must be signed in to change notification settings - Fork 18
/
main.yml
407 lines (378 loc) · 11.2 KB
/
main.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
---
# general
prefix: /data
tmp_dir: /tmp
ipaddress: "{{ ansible_default_ipv4.address }}"
external_ipaddress: "{{ ipaddress }}"
project: xtesting
db_project: "{{ project }}"
use_node: # true if runners/agents are deployed
user_mail: root@localhost
offline: false
deps_only: false
kubernetes_deploy: false
kubernetes_recreate: false
use_kubernetes: "{{ kubernetes_deploy }}"
use_podman: false
# testcases
repo: opnfv
dport: # 5000 if private registry
docker_tags:
- latest:
branch: master
dependency: '3.13'
# node: lf-build2
docker_args:
env: {}
volumes: []
published_ports: []
suites:
- container: xtesting
# privileged: false
# network: bridge
# uid: 1000
# gid: 1000
tests:
- first
- second
- third
- fourth
- fifth
- sixth
- eighth
- nineth
triggers:
- timed: '@daily'
use_artifacts: false
use_artifacts_from:
# compatibilities
sudo1: # sudo if sudo has to be called
pip_extra_args: --no-deps
properties:
- build-blocker:
# block-level: GLOBAL or NODE
blocking-jobs:
- "^{{ project + '-' + jenkins_extra_prefix }}{tag}({{ jenkins_campaign_suffix }}|-docker|-review)$"
# job_properties:
# kill-phase-on: FAILURE
# abort-all-job: true
# docker
docker_pull: '{{ not offline }}'
docker_recreate: false
docker_restart_policy: always
docker_image: docker:24-dind
jenkins_docker_image: opnfv/xtesting-jenkins
jenkins_docker_tag: lts-slim
jenkins_k8s_image: jenkins/jenkins
jenkins_k8s_tag: lts-slim
jenkins_agent_docker_image: opnfv/xtesting-jenkins-agent
jenkins_agent_docker_tag: 4.9-bullseye
jenkins_agent_auto_docker_image: opnfv/xtesting-jenkins-agent-auto
jenkins_agent_auto_docker_tag: 4.9-bullseye
gitlab_docker_image: gitlab/gitlab-ce
gitlab_version: 16.0.1
gitlab_docker_tag: '16.0.1-ce.0'
gitlab_sharedrunner_image: gitlab/gitlab-runner:v15.11.1
gitlab_privaterunner_image: "{{ gitlab_sharedrunner_image }}"
nexus_docker_image: sonatype/nexus3
nexus_docker_tag: 3.45.1
influxdb_docker_image: influxdb
influxdb_docker_tag: 2.3.0-alpine
influxdb_k8s_image: '{{ influxdb_docker_image }}'
influxdb_k8s_tag: '{{ influxdb_docker_tag }}'
minio_docker_image: minio/minio
minio_docker_tag: RELEASE.2023-01-18T04-36-38Z
minio_s3www_docker_image: opnfv/xtesting-s3www
minio_s3www_docker_tag: v0.5.3
radosgw_docker_image: ceph/daemon
radosgw_docker_tag: latest@sha256:261bbe628f4b438f5bf10de5a8ee05282f2697a5a2cb7ff7668f776b61b9d586
mongo_docker_image: mongo
mongo_docker_tag: 6.0.3
mongo_k8s_image: bitnami/mongodb
mongo_k8s_tag: 6.0.3-debian-11-r20
postgres_docker_image: postgres
postgres_docker_tag: 15.1-alpine
postgres_k8s_image: bitnami/postgresql
postgres_k8s_tag: 15.1.0-debian-11-r20
cachet_docker_image: cachethq/docker
cachet_docker_tag: latest@sha256:71c5d2a0ad34bca1878f00b4660a9a6294c3cc0020b1bd49c299344ad0ba8006
cachet_url_monitor_docker_image: mtakaki/cachet-url-monitor
cachet_url_monitor_docker_tag: release-0.6.9
elasticsearch_docker_image: elasticsearch
elasticsearch_docker_tag: 8.5.1
elasticsearch_k8s_image: "{{ elasticsearch_docker_image }}"
elasticsearch_k8s_tag: "{{ elasticsearch_docker_tag }}"
kibana_docker_image: kibana
kibana_docker_tag: 8.5.1
kibana_k8s_image: "{{ kibana_docker_image }}"
kibana_k8s_tag: "{{ kibana_docker_tag }}"
fluentd_docker_image: fluent/fluentd
fluentd_docker_tag: v1.15
gitea_docker_image: gitea/gitea
gitea_docker_tag: 1.18.1
grafana_docker_image: grafana/grafana
grafana_docker_tag: 9.3.1
grafana_k8s_image: "{{ grafana_docker_image }}"
grafana_k8s_tag: "{{ grafana_docker_tag }}"
registry_docker_image: registry
registry_docker_tag: 2
testapi_docker_image: opnfv/testapi
testapi_docker_tag: kali
vault_docker_image: vault
vault_docker_tag: 1.12.2
nginx_docker_image: nginx
nginx_docker_tag: 1.23
# helm
jenkins_chart_version: 4.2.20
gitlab_chart_version: 7.0.1
mongo_chart_version: 13.6.2
postgres_chart_version: 12.1.9
elasticsearch_chart_version: 8.5.1
grafana_chart_version: 6.50.0
kibana_chart_version: 8.5.1
influxdb_chart_version: 2.1.1
# jenkins
jenkins_deploy: true
jenkins_port: 8080
jenkins_jnlp_port: 50000
jenkins_prefix: /
jenkins_url: "http://{{ ipaddress }}:{{ jenkins_port }}{{ jenkins_prefix }}"
jenkins_user: admin
jenkins_password: admin
jenkins_workspace: "{{ prefix }}/jenkins/workspace"
jenkins_configure: "{{ jenkins_deploy }}"
jenkins_create_jobs: "{{ jenkins_configure }}"
jenkins_wait: 120
jenkins_network_mode: bridge # or host
jenkins_agent_deploy: false
jenkins_agent_network_mode: bridge # or host
jenkins_agent_name: xtesting
jenkins_multi_projects: true
jenkins_multi_repos: true
jenkins_extra_prefix: "" # prefix-
jenkins_extra_suffix: "" # -run
jenkins_campaign_suffix: "-daily"
# jenkins_view_daily_regex:
# jenkins_view_review_regex:
# jenkins_view_tox_regex:
# jenkins_view_docker_regex:
# jenkins_view_trivy_regex:
# jenkins_view_grype_regex:
# jenkins_view_sbom_regex:
jenkins_pollscm: "*/30 * * * *"
jenkins_publishers:
# - email-ext:
# recipients: {{ user_mail }}
# failure: false
# first-failure: true
# fixed: true
jenkins_wrappers:
# - timeout:
# timeout: 90
# fail: true
# type: absolute
# gitlab
gitlab_deploy: false
gitlab_port: 80
gitlab_shell_port: 32022
gitlab_registry_port: 5050
gitlab_url: http://{{ ipaddress }}:{{ gitlab_port }}
gitlab_registry_url: http://{{ ipaddress }}:{{ gitlab_registry_port }}
gitlab_configure: "{{ gitlab_deploy }}"
gitlab_create_jobs: "{{ gitlab_configure }}"
gitlab_root_password: xtest1ng23
gitlab_user: xtesting
gitlab_user_password: xtest1ng23
gitlab_clone_url: "http://{{ gitlab_user }}:{{ gitlab_user_password }}@\
{{ ipaddress }}:{{ gitlab_port }}/xtesting/{{ project }}.git"
gitlab_wait: 300
gitlab_commit_msg: Update .gitlab-ci.yml via XtestingCI
gitlab_user_mail: "{{ user_mail }}"
gitlab_clone_version: main
gitlab_enable_scheduling: true
gitlab_sharedrunner_deploy: "{{ gitlab_deploy }}"
gitlab_sharedrunner_concurrent: 10
gitlab_privaterunner_deploy: "{{ docker_args.volumes | length > 0 }}"
gitlab_privaterunner_concurrent: 10
gitlab_privaterunner_network_mode: bridge # or host
gitlab_privaterunner_extra_hosts:
# - foo:127.0.0.1
gitlab_ci_mode: "overwrite" # or insert
gitlab_use_chainedci: false
# s3
publish_to_s3: true
minio_deploy: true
minio_port: 9000
minio_console_port: 9001
s3www_port: 8181
radosgw_deploy: false
radosgw_port: 8081
radosgw_wait: 120
nano_port: 5001
s3_dst_url: s3://xtesting
aws_access_key_id: xtesting
aws_secret_access_key: xtesting
bucket: xtesting
s3_mask_creds: false
boto: "{{ prefix }}/boto"
s3_endpoint_url: http://{{ ipaddress }}:{{ minio_port }}
http_dst_url: http://{{ external_ipaddress }}:{{ s3www_port }}
# db
push_to_db: true
mongo_deploy: true
mongo_port: 27017
mongo_wait: 1
mongo_root_username: xtesting
mongo_root_password: xtesting
mongo_url: mongodb://{{ mongo_root_username }}:{{ mongo_root_password }}@{{
ipaddress }}:{{ mongo_port }}
node_name: '{{ project }}'
# testapi
testapi_deploy: true
testapi_configure: '{{ testapi_deploy }}'
testapi_port: 8000
testapi_url: http://{{ ipaddress }}:{{ testapi_port }}/api/v1
testapi_ext_url: http://{{ external_ipaddress }}:{{ testapi_port }}/api/v1
testapi_base_url: http://{{ external_ipaddress }}:{{ testapi_port }}
testapi_wait: 30
# postgres
postgres_deploy: false
postgres_port: 5432
postgres_host: '{{ ipaddress }}'
postgres_username: postgres
postgres_password: postgres
postgres_database: postgres
postgres_wait: 30
# cachet
cachet_deploy: false
cachet_configure: '{{ cachet_deploy }}'
cachet_wait: 30
cachet_port: 8001
cachet_url: 'http://{{ ipaddress }}:{{ cachet_port }}/api/v1'
cachet_appkey: base64:q/6JoobF1ztJeNkrthsC2eln62j/M6RRE585qyDTZ7I=
cachet_settings:
- name: app_name
value: '{{ project }}'
- name: app_domain
value: http://{{ external_ipaddress }}:{{ cachet_port }}
- name: app_timezone
value: UTC
- name: app_locale
value: en
- name: show_support
value: 0
- name: app_incident_days
value: 7
cachet_user: xtesting
cachet_password: "{{ 'xtesting' | password_hash('sha512') }}"
cachet_user_mail: "{{ user_mail }}"
cachet_api_key: xtesting
cachet_remember_token: NONE
cachet_poll_timeout: 10
cachet_poll_frequency: 50
cachet_poll_extra_args: # &installer={{ project }}
# registry
registry_deploy: false
registry_port: 5000
# influxdb
influxdb_deploy: false
influxdb_port: 8086
influxdb_url: http://{{ ipaddress }}:{{ influxdb_port }}
influxdb_wait: 30
influxdb_username: admin
influxdb_password: admin123
# grafana
grafana_deploy: false
grafana_port: 3000
grafana_wait: 30
grafana_username: admin
grafana_password: admin # unused if deployed in Kubernetes
grafana_url: http://{{ ipaddress }}:{{ grafana_port }}
# elasticsearch
elasticsearch_deploy: false
elasticsearch_port: 9200
elasticsearch_url: http://{{ ipaddress }}:{{ elasticsearch_port }}
elasticsearch_wait: 1
# kibana
kibana_deploy: false
kibana_port: 5601
kibana_wait: 30
# fluentd
fluentd_deploy: false
fluentd_port: 24224
fluentd_wait: 30
# gitea
gitea_deploy: false
gitea_port: 3001
gitea_ssh_port: 222
gitea_url: http://{{ ipaddress }}:{{ gitea_port }}
gitea_wait: 20
# vault
vault_deploy: false
vault_port: 8200
vault_wait: 1
# nexus
nexus_deploy: false
nexus_port: 8082
nexus_url: http://{{ ipaddress }}:{{ nexus_port }}
nexus_wait: 240
# nginx
nginx_deploy: false
nginx_port: 443
nginx_url: https://{{ ipaddress }}
nginx_wait: 60
ssl_certificate: '{{ playbook_dir }}/xtesting.crt'
ssl_certificate_key: '{{ playbook_dir }}/xtesting.key'
nginx_jenkins_location: '{{ jenkins_prefix }}'
nginx_testapi_location: '/testapi'
nginx_s3_location: '/s3'
# gating
build_only: false
use_gerrit: false
gerrit_project: functest-xtesting
git_url: # https://gerrit.opnfv.org/gerrit/{{ gerrit_project }}
builds:
dependency:
repo: _
dport: # 5000 if private registry
container: alpine
steps:
- name: opnfv/xtesting
containers:
- name: xtesting
ref_arg: BRANCH
path: docker/core
# Debian (opnfv/xtesting-jenkins:lts-slim)
install_trivy_deps: |
apt-get -o DPkg::Lock::Timeout=300 update && \
DEBIAN_FRONTEND=noninteractive apt-get -o DPkg::Lock::Timeout=300 install \
curl -y
install_grype_deps: |
apt-get -o DPkg::Lock::Timeout=300 update && \
DEBIAN_FRONTEND=noninteractive apt-get -o DPkg::Lock::Timeout=300 install \
curl -y
install_sbom_deps: |
apt-get -o DPkg::Lock::Timeout=300 update && \
DEBIAN_FRONTEND=noninteractive apt-get -o DPkg::Lock::Timeout=300 install \
curl -y
install_tox_deps: |
apt-get -o DPkg::Lock::Timeout=300 update && \
DEBIAN_FRONTEND=noninteractive apt-get -o DPkg::Lock::Timeout=300 \
dist-upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get -o DPkg::Lock::Timeout=300 install \
wget python3-pip tox -y && \
wget -O- \
https://people.debian.org/~paravoid/python-all/unofficial-python-all.asc \
| apt-key add - && \
echo "deb http://people.debian.org/~paravoid/python-all buster main" \
| tee /etc/apt/sources.list.d/python-all.list && \
apt-get -o DPkg::Lock::Timeout=300 update && \
DEBIAN_FRONTEND=noninteractive apt-get -o DPkg::Lock::Timeout=300 install \
python3.8 python3.8-dev -y
# Alpine (opnfv/xtesting-jenkins:lts-alpine)
# install_trivy_deps: apk add --update curl
# install_grype_deps: apk add --update curl
# install_tox_deps: |
# apk add --update build-base libxml2-dev libxslt-dev libffi-dev \
# openssl-dev libjpeg-turbo-dev rust cargo python3 python3-dev \
# py3-pip py3-wheel py3-tox