Commit 847dc0be by Arve Knudsen Committed by GitHub

Drone: Fix grafana-mixin linting (#28308)

* Drone: Fix Starlark script

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* grafana-mixin: Move build logic to scripts

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Drone: Use mixin scripts

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CI build image: Install jsonnetfmt and mixtool

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Makefile: Print commands

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
parent 4937f0da
JSONNET_FMT := jsonnetfmt -n 2 --max-blank-lines 2 --string-style s --comment-style s
all: fmt lint build clean
fmt:
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
xargs -n 1 -- $(JSONNET_FMT) -i
./scripts/format.sh
lint:
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
while read f; do \
$(JSONNET_FMT) "$$f" | diff -u "$$f" -; \
done
mixtool lint mixin.libsonnet
./scripts/lint.sh
build:
mixtool generate all mixin.libsonnet
./scripts/build.sh
clean:
rm -rf dashboards_out alerts.yaml rules.yaml
#!/bin/bash
set -eo pipefail
cd "$(dirname "$0")"/..
mixtool generate all mixin.libsonnet
JSONNET_FMT="jsonnetfmt -n 2 --max-blank-lines 2 --string-style s --comment-style s"
#!/bin/bash
set -eo pipefail
cd "$(dirname "$0")"/..
. scripts/common.sh
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
xargs -n 1 -- ${JSONNET_FMT} -i
#!/bin/bash
set -eo pipefail
cd "$(dirname "$0")"/..
. scripts/common.sh
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
while read f; do \
${JSONNET_FMT} "$f" | diff -u "$f" -; \
done
mixtool lint mixin.libsonnet
......@@ -155,7 +155,11 @@ RUN cd /tmp && \
tar xf x86_64-linux-musl-cross.tgz && \
rm x86_64-linux-musl-cross.tgz
RUN go get -u github.com/mgechev/revive@v1.0.2
RUN mv ${GOPATH}/bin/revive /usr/local/bin/
RUN go get -u github.com/mgechev/revive@v1.0.2 && \
mv ${GOPATH}/bin/revive /usr/local/bin/ && \
go get github.com/google/go-jsonnet/cmd/jsonnetfmt && \
mv ${GOPATH}/bin/jsonnetfmt /usr/local/bin/ && \
go get github.com/monitoring-mixins/mixtool/cmd/mixtool && \
mv ${GOPATH}/bin/mixtool /usr/local/bin/
COPY ./bootstrap.sh /tmp/bootstrap.sh
#!/bin/bash
set -eo pipefail
_version="1.2.27"
_version="1.2.28"
_tag="grafana/build-container:${_version}"
_dpath=$(dirname "${BASH_SOURCE[0]}")
......
grabpl_version = '0.5.18'
build_image = 'grafana/build-container:1.2.27'
build_image = 'grafana/build-container:1.2.28'
publish_image = 'grafana/grafana-ci-deploy:1.2.6'
grafana_docker_image = 'grafana/drone-grafana-docker:0.3.2'
alpine_image = 'alpine:3.12'
......@@ -224,7 +224,8 @@ def lint_backend_step(edition):
'revive -formatter stylish -config scripts/go/configs/revive.toml ./pkg/...',
'./scripts/revive-strict',
'./scripts/tidy-check.sh',
'./scripts/mixin-check.sh,
'./grafana-mixin/scripts/lint.sh',
'./grafana-mixin/scripts/build.sh',
],
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment