CI plugin to validate yaml files
docker run --rm \
-e PLUGIN_DEBUG=true \
-v path/to/yamls:/work \
-w /work \
devatherock/drone-yaml-validator:latest
The following parameters can be set to configure the plugin.
-
debug - Flag to enable debug logs. Optional, by default, debug logs are disabled
-
continue_on_error - Flag to indicate if processing should continue when an invalid file is encountered. Optional, defaults to true
-
search_path - If specified, only YAMLs present in this path will be validated
-
allow_duplicate_keys - Flag to indicate if YAML files with duplicate keys should be considered valid. Optional, defaults to false
-
ignore_unknown_tags - Flag to indicate if YAML files with unknown tags should be considered valid. Optional, defaults to true
steps:
- name: yaml_validator
ruleset:
branch: master
event: push
image: devatherock/drone-yaml-validator:latest
parameters:
debug: false
continue_on_error: true
allow_duplicate_keys: false
ignore_unknown_tags: true
steps:
- name: yaml_validator
image: devatherock/drone-yaml-validator:latest
settings:
debug: false
continue_on_error: true
allow_duplicate_keys: false
ignore_unknown_tags: true
version: 2.1
jobs:
validate_yamls:
docker:
- image: devatherock/drone-yaml-validator:latest
working_directory: ~/my-repo
environment:
PARAMETER_DEBUG: false
PARAMETER_CONTINUE_ON_ERROR: true
PARAMETER_ALLOW_DUPLICATE_KEYS: false
PARAMETER_IGNORE_UNKNOWN_TAGS: true
steps:
- checkout
- run: sh /scripts/entry-point.sh
To test the latest plugin image, run the below command
make functional-test