Skip to content
Snippets Groups Projects
Commit 693cd092 authored by Pierre SMEYERS's avatar Pierre SMEYERS
Browse files

Merge branch '1-hadolint-report-in-json-format' into 'master'

feat: add JSON output format for Hadolint report

Closes #1

See merge request to-be-continuous/docker!9
parents 6cb9d988 d98093d8
No related branches found
No related tags found
No related merge requests found
...@@ -451,18 +451,20 @@ docker-hadolint: ...@@ -451,18 +451,20 @@ docker-hadolint:
- autoconfig_hadolint - autoconfig_hadolint
- mkdir -p reports - mkdir -p reports
- chmod o+rwx reports - chmod o+rwx reports
- hadolint_report_name="hadolint-$(md5sum "$DOCKER_FILE" | cut -d" " -f1).json" - dockerfile_hash=$(md5sum "$DOCKER_FILE" | cut -d" " -f1)
# Force one run with tty format in order to have a nice output without failure # Output in Code Climate format (GitLab integration)
- hadolint --no-fail $DOCKER_HADOLINT_ARGS $hadolint_config_opts "$DOCKER_FILE" - hadolint --no-fail -f gitlab_codeclimate $DOCKER_HADOLINT_ARGS $hadolint_config_opts "$DOCKER_FILE" > "reports/hadolint-cc-${dockerfile_hash}.json"
# Make one run with ad hoc output for gitlab integration # Output in JSON format
- hadolint -f gitlab_codeclimate $DOCKER_HADOLINT_ARGS $hadolint_config_opts "$DOCKER_FILE" > "reports/$hadolint_report_name" - hadolint --no-fail -f json $DOCKER_HADOLINT_ARGS $hadolint_config_opts "$DOCKER_FILE" > "reports/hadolint-json-${dockerfile_hash}.json"
# las run with console output (with failure)
- hadolint $DOCKER_HADOLINT_ARGS $hadolint_config_opts "$DOCKER_FILE"
artifacts: artifacts:
name: "$CI_JOB_NAME artifacts from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG" name: "$CI_JOB_NAME artifacts from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG"
expire_in: 1 day expire_in: 1 day
when: always when: always
reports: reports:
codequality: codequality:
- "reports/hadolint-*.json" - "reports/hadolint-cc-*.json"
paths: paths:
- "reports/hadolint-*.json" - "reports/hadolint-*.json"
rules: rules:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment