Commit 3c277630 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

Merge branch 'feat/normalize-reports' into 'master'

normalize reports

See merge request to-be-continuous/ansible!28
parents 966d0783 6ff3fbc5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -261,6 +261,12 @@ Here are its parameters:
| `ANSIBLE_LINT_IMAGE`    | The Docker image used to run Ansible Lint | `haxorof/ansible-lint:latest` |
| `ANSIBLE_LINT_DISABLED` | Set to `true` to disable the `ansible lint` analysis  | _none_ (enabled) |

In addition to a textual report in the console, this job produces the following report, kept for one day:

| Report         | Format                                                                       | Usage             |
| -------------- | ---------------------------------------------------------------------------- | ----------------- |
| `$ANSIBLE_PROJECT_DIR/reports/ansible-lint-*.codeclimate.json` | [codeclimate format](https://ansible-lint.readthedocs.io/usage/#id2) | [GitLab integration](https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportscodequality) |

## Examples

* Review environment enabled,
+17 −0
Original line number Diff line number Diff line
@@ -464,10 +464,21 @@ stages:
    entrypoint: [""]
  script:
    - ansible-lint main.yml
  artifacts:
    name: "$CI_JOB_NAME artifacts from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG"
    expire_in: 1 day
    when: always
    reports:
      codequality:
        - "$ANSIBLE_PROJECT_DIR/reports/ansible-lint-*.codeclimate.json"
    paths:
      - "$ANSIBLE_PROJECT_DIR/reports/ansible-lint-*.codeclimate.json"

ansible-lint-review:
  extends: .ansible-lint-base
  script:
    - mkdir -p -m 777 reports
    - ansible-lint "$ANSIBLE_REVIEW_PLAYBOOK_FILE" -f codeclimate > reports/ansible-lint-review.codeclimate.json || true
    - ansible-lint "$ANSIBLE_REVIEW_PLAYBOOK_FILE"
  rules:
    # exclude when $ANSIBLE_LINT_DISABLED is set
@@ -481,6 +492,8 @@ ansible-lint-review:
ansible-lint-integration:
  extends: .ansible-lint-base
  script:
    - mkdir -p -m 777 reports
    - ansible-lint "$ANSIBLE_INTEG_PLAYBOOK_FILE" -f codeclimate > reports/ansible-lint-integration.codeclimate.json || true
    - ansible-lint "$ANSIBLE_INTEG_PLAYBOOK_FILE"
  rules:
    # exclude when $ANSIBLE_LINT_DISABLED is set
@@ -494,6 +507,8 @@ ansible-lint-integration:
ansible-lint-staging:
  extends: .ansible-lint-base
  script:
    - mkdir -p -m 777 reports
    - ansible-lint "$ANSIBLE_STAGING_PLAYBOOK_FILE" -f codeclimate > reports/ansible-lint-staging.codeclimate.json || true
    - ansible-lint "$ANSIBLE_STAGING_PLAYBOOK_FILE"
  rules:
    # exclude when $ANSIBLE_LINT_DISABLED is set
@@ -507,6 +522,8 @@ ansible-lint-staging:
ansible-lint-prod:
  extends: .ansible-lint-base
  script:
    - mkdir -p -m 777 reports
    - ansible-lint "$ANSIBLE_PROD_PLAYBOOK_FILE" -f codeclimate > reports/ansible-lint-prod.codeclimate.json || true
    - ansible-lint "$ANSIBLE_PROD_PLAYBOOK_FILE"
  rules:
    # exclude when $ANSIBLE_LINT_DISABLED is set