Skip to content
Snippets Groups Projects
Unverified Commit cdcdc030 authored by Craig Miskell's avatar Craig Miskell
Browse files

fix: Clean up unexpected tflint-reports, and only upload XML

There's some weird behavior in CI where tflint-reports ends up with a nested tflint-reports directory, leading to a failure to upload (the uploader doesn't handle nested directories, only a list of files).  Plausibly some sort of caching (git fetch vs git clone perhaps), but even then it's not clear how the nesting occurs.  Debugging this would be interesting, but time consuming and inefficient.  Therefore, fix this two ways:
1. Delete any pre-existing tflint-reports directory before creating it
2. Only upload *.xml, not **; if any other stray directories still sneak in, they won't be picked up

Example: https://gitlab.com/gitlab-com/gl-infra/gitlab-dedicated/amp/-/jobs/3724020834
parent 382af58d
No related branches found
No related tags found
No related merge requests found
Pipeline #15483383 passed
Loading
Loading
@@ -5,6 +5,7 @@ tflint:
name: registry.gitlab.com/gitlab-com/gl-infra/common-ci-tasks-images/tflint:${GL_ASDF_TFLINT_VERSION}
entrypoint: [""]
script:
- rm -rf "tflint-reports/"
- mkdir -p "tflint-reports/"
# Find all TF files and lint the directories of those files
- tflint --init -c .tflint.hcl
Loading
Loading
@@ -32,7 +33,7 @@ tflint:
artifacts:
when: always
reports:
junit: tflint-reports/**
junit: tflint-reports/*.xml
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment