Sign inSign up

bestit/qa-yaml-lint

By bestit

•Updated 10 months ago

Slim Docker image packaging yaml-lint

Image
Integration & delivery
Developer tools
0

579

bestit/qa-yaml-lint repository overview

⁠bestit/qa-yaml-lint

Yaml Lint based on j13k/yaml-lint⁠

⁠Usage

⁠Linting a single file

To lint a single YAML file:

docker run -v $PWD:/workdir --workdir /workdir --rm bestit/qa-yaml-lint:1.1.6 path/to/file.yaml
⁠Linting all YAML files in a directory

To scan and lint all YAML files in a directory, use the lint-yaml-files.sh script:

docker run -v $PWD:/workdir --workdir /workdir --rm bestit/qa-yaml-lint:1.1.6 lint-yaml-files.sh [directory]

The script will:

  • Recursively find all .yaml and .yml files in the specified directory (defaults to current directory)
  • Run yaml-lint on each file
  • Display error output for failed files
  • Show a summary with total, passed, and failed file counts
⁠Ignoring files

You can exclude files from linting using the --ignore-file option with a regex pattern:

docker run -v $PWD:/workdir --workdir /workdir --rm bestit/qa-yaml-lint:1.1.6 lint-yaml-files.sh . --ignore-file "node_modules" --ignore-file "vendor"

Multiple --ignore-file patterns can be specified, and they will be combined with OR logic.

⁠Releasing new versions

The build is using a docker multi stage build. To release a new version the following steps are required:

  1. Update tool_version in Dockerfile (amd64) and Dockerfile.arm64v8 (arm64v8)
  2. Update versions in multi-arch-manifest.yaml for both platforms.
  3. Update CHANGLOG.md accordingly.
  4. Push new tag, dockerhub will start the build automatically.

⁠Local Testing

To test the Dockerfiles locally you can execute this command to build the image on amd64 and arm64 architectures:

docker buildx build --force-rm --no-cache -t qa-yaml-lint --platform linux/arm64,linux/amd64 . && docker run -it qa-yaml-lint

Tag summary

Content type

Image

Digest

sha256:424c71fa0…

Size

34.3 MB

Last updated

10 months ago

docker pull bestit/qa-yaml-lint:1.1.7