* Add DroneCI pipeline stage to validate loki example configs; create example configuration files
* Actually run loki in the validate-example-configurations pipeline stage
* Change method for running loki binary
* Add step dependency for config validation pipeline stage
* Actually loop over example configs and verify them!
* Push bad config to test failing builds
* Create remaining example configs
* Fix provided example loki configs
* Use make target to validate example configs
* Add make target to generate a new example configuration doc; add make target for CI to verify doc is re-generated upon changes to example configs
* Update CI to check the generated example config doc
* Clean up Makefile
* Mark new example config validation make targets as phony; fix conditional for config example doc checking
* Fix conditional
* Remove redundant step in generate-example-config-doc phony make target
* Add a correction to PR 4358
* Improve grammar and add newlines in example configuration descriptions
Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>
* Regenerate examples.md
Co-authored-by: Karen Miller <karen.miller@grafana.com>
Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>
-type f -name '*.go' -exec goimports -w -local github.com/grafana/loki {}\;
###################
# Example Configs #
###################
# Validate the example configurations that we provide in ./docs/sources/configuration/examples
validate-example-configs:loki
for f in ./docs/sources/configuration/examples/*.yaml;doecho"Validating provided example config: $$f"&& ./cmd/loki/loki -config.file=$$f -verify-config ||exit 1;done
# Dynamically generate ./docs/sources/configuration/examples.md using the example configs that we provide.
# This target should be run if any of our example configs change.
generate-example-config-doc:
echo"Removing existing doc at loki/docs/configuration/examples.md and re-generating. . ."
# Append each configuration and its file name to examples.md
for f in ./docs/sources/configuration/examples/*.yaml;doecho -e "\n## $$(basename $$f)\n\n\`\`\`yaml\n$$(cat $$f)\n\`\`\`\n" >> ./docs/sources/configuration/examples.md;done
# Fail our CI build if changes are made to example configurations but our doc is not updated