mirror of
https://github.com/grafana/loki.git
synced 2025-07-25 16:15:16 +08:00

* Lint script files. This patch adds a Drone CI step that runs shellcheck on all Bash script files. * Install Bash in shellcheck container. * Fix a few shelcheck errors. * Fix build.sh * Fix remaining shellcheck errors.
25 lines
664 B
Bash
Executable File
25 lines
664 B
Bash
Executable File
#!/bin/sh
|
|
|
|
##########################################
|
|
# Generate the scrape_config for the
|
|
# promtail.sh script and the helm chart.
|
|
#
|
|
# The scrape_config is built from the
|
|
# scrape_config defined in the promtail
|
|
# ksonnet library.
|
|
#########################################
|
|
|
|
BASE=$(dirname "$0")
|
|
|
|
target=${1:-shell}
|
|
|
|
case "${target}" in
|
|
"shell")
|
|
(cd "${BASE}" || exit; jsonnet -e '((import "../production/ksonnet/promtail/scrape_config.libsonnet") + { _config:: { promtail_config: { pipeline_stages: ["<parser>"]}}}).promtail_config' | ytools 2>/dev/null)
|
|
;;
|
|
|
|
*)
|
|
echo "unknown target. expected 'shell' or 'helm'"
|
|
exit 1
|
|
esac
|