-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
66 lines (63 loc) · 1.76 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
---
shellcheck:
stage: 'test'
image:
name: '${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/koalaman/shellcheck-alpine:stable'
entrypoint: ['']
tags:
- 'docker'
- 'amd64'
script:
- 'find . -type f -iname "*.sh" -print0 | xargs -0 shellcheck -s bash -e SC1091'
rules:
- if: '($CI_PIPELINE_SOURCE == "web" || $CI_PIPELINE_SOURCE == "webide" || $CI_PIPELINE_SOURCE == "api") && $FORCE_BUILD'
- if: '$CI_PIPELINE_SOURCE == "push"'
changes:
- '**/*.sh'
compose:
stage: 'test'
image:
name: '${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker/compose:1.29.2'
entrypoint: ['']
tags:
- 'docker'
- 'amd64'
script: |
find . \
-type f \
-iname "*docker-compose.yml" \
-not -path "./ansible/roles/docker-stack/files/compose/comet/*" \
-print0 \
| xargs -n 1 -0 -I "{}" docker-compose -f {} config -q
rules:
- if: '($CI_PIPELINE_SOURCE == "web" || $CI_PIPELINE_SOURCE == "webide" || $CI_PIPELINE_SOURCE == "api") && $FORCE_BUILD'
- if: '$CI_PIPELINE_SOURCE == "push"'
changes:
- '**/docker-compose.yml'
ansible-lint:
stage: 'test'
image:
name: '${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/cytopia/ansible-lint:latest'
entrypoint: ['']
tags:
- 'docker'
- 'amd64'
script: |
cd ansible
ROLES=""
for ROLE in $(ls roles/); do
ROLES="${ROLES} - '${ROLE}'\n"
echo "linting role: ${ROLE}"
done
cat <<- EOF > ./.lint.yml
- hosts: 'lint'
roles:
$(echo -e $ROLES | sed -E "s/^[ ]{0,1}- '/ - '/g")
EOF
ansible-lint ./.lint.yml
rules:
- if: '($CI_PIPELINE_SOURCE == "web" || $CI_PIPELINE_SOURCE == "webide" || $CI_PIPELINE_SOURCE == "api") && $FORCE_BUILD'
- if: '$CI_PIPELINE_SOURCE == "push"'
changes:
- 'ansible/*'
- 'ansible/**/*'