-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
31 lines (29 loc) · 1.03 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
stages:
- linting
commitlint:
stage: linting
image: registry.hub.docker.com/library/node:alpine
variables:
GIT_DEPTH: 0
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
before_script:
- apk add --no-cache git
- npm install --save-dev @commitlint/config-conventional @commitlint/cli
script:
- npx commitlint --extends '@commitlint/config-conventional' --from "${CI_MERGE_REQUEST_DIFF_BASE_SHA}" --to "${CI_COMMIT_SHA}"
ansible-lint:
stage: linting
image: registry.gitlab.com/pipeline-components/ansible-lint:latest
script:
- ansible-lint --show-relpath ansible -f codeclimate | python -m json.tool | tee "${CI_PROJECT_DIR}/codeclimate-results.json"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_PIPELINE_SOURCE == "push"'
artifacts:
name: "$CI_JOB_NAME artifacts from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG"
reports:
codequality:
- "${CI_PROJECT_DIR}/codeclimate-results.json"
paths:
- "${CI_PROJECT_DIR}/codeclimate-results.json"