Loading README.md +6 −0 Original line number Diff line number Diff line Loading @@ -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, Loading templates/gitlab-ci-ansible.yml +17 −0 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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 Loading @@ -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 Loading @@ -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 Loading Loading
README.md +6 −0 Original line number Diff line number Diff line Loading @@ -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, Loading
templates/gitlab-ci-ansible.yml +17 −0 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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 Loading @@ -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 Loading @@ -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 Loading