-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
109 lines (99 loc) · 2.46 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
---
stages:
- lint
- build
variables:
ANSIBLE_FORCE_COLOR: 'true'
lint:
stage: lint
image: registry.getnoc.com/infrastructure/ansible_linter:master
script:
- export ANSIBLE_ROLES_PATH=./additional_roles:./system_roles:./noc_roles
- export ANSIBLE_LIBRARY=./library:./system_roles/mongod/library
- yamllint --version
- yamllint -s .
- ansible-playbook --version
- for inv in molecule/*/inv.yml; do ansible-playbook */*/service.yml --syntax-check -i $inv; done
- ansible-lint --version
#- ansible-lint */*/service.yml -v
- ansible-review --version
- git ls-files | grep -v molecule/ | xargs -P 32 -n 4 ansible-review -c .ansible-review -q
tags:
- docker
.base_builder:
stage: build
image: registry.getnoc.com/infrastructure/molecule-docker:stable
before_script:
- echo ${ssh_identity_text} | tr -d ' ' | base64 -d > /tmp/temporary_ssh_key
- chmod 0400 /tmp/temporary_ssh_key
- echo ${ssh_identity_text_pub} | tr -d ' ' | base64 -d > /tmp/temporary_ssh_key_pub
- chmod 0644 /tmp/temporary_ssh_key_pub
script:
- molecule --version
- ansible-playbook --version
- molecule test -s $SCENARIO_NAME
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
paths:
- /tmp/dist
variables:
PIP_CACHE: /root/.cache/pip
PKG_CACHE: /var/cache/apt/archives
only:
- branches@noc/ansible_deploy
- master@noc/ansible_deploy
build_centos:
extends: .base_builder
variables:
PKG_CACHE: /var/cache/yum
SCENARIO_NAME: default
tags:
- cloud
- docker
build_debian9:
extends: .base_builder
variables:
SCENARIO_NAME: debian9
tags:
- cloud
- docker
build_debian10:
extends: .base_builder
variables:
SCENARIO_NAME: debian10
tags:
- cloud
- docker
build_ubuntu16:
extends: .base_builder
variables:
SCENARIO_NAME: ubuntu16
tags:
- cloud
- docker
build_ubuntu18:
extends: .base_builder
variables:
SCENARIO_NAME: ubuntu18
tags:
- cloud
- docker
build_freebsd:
extends: .base_builder
variables:
PKG_CACHE: /var/cache/pkg
SCENARIO_NAME: freebsd
USE_CACHE: "False" # freebsd minio-client "broken"
tags:
- satel
- docker
allow_failure: true # to hard to maintain without maintainer. often incompatible changes
build_oel7:
extends: .base_builder
variables:
PKG_CACHE: /var/cache/yum
SCENARIO_NAME: oel7
tags:
- satel
- docker
allow_failure: true # no active users for platform