forked from grafana/jsonnet-libs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use mixtool to lint mixins (grafana#357)
* Make link use mixtool to ensure mixins compile and lint. Signed-off-by: Tom Wilkie <[email protected]> * Add jsonnetfile for jaeger-mixin, update others. Signed-off-by: Tom Wilkie <[email protected]> * Add UIDs for dashboards so they lint. Based on the md5 of the filename, same as prometheus-ksonnet. Signed-off-by: Tom Wilkie <[email protected]> * Put @ back Signed-off-by: Tom Wilkie <[email protected]> * Make it work in CI Signed-off-by: Tom Wilkie <[email protected]> * Add bash to CI container. Signed-off-by: Tom Wilkie <[email protected]> * Add jb to build image. Signed-off-by: Tom Wilkie <[email protected]> * Update Makefile Co-authored-by: sh0rez <[email protected]> Co-authored-by: sh0rez <[email protected]>
- Loading branch information
Showing
9 changed files
with
83 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,28 @@ | ||
# Dockerfile for image used to run CI. | ||
|
||
FROM alpine:3.7 | ||
# Build jsonnet | ||
FROM alpine:3.7 AS jsonnet-builder | ||
RUN apk --no-cache add alpine-sdk git | ||
RUN git clone https://github.com/google/jsonnet | ||
RUN git -C jsonnet checkout v0.15.0 | ||
RUN make -C jsonnet LDFLAGS=-static | ||
|
||
# Build jb | ||
FROM alpine:3.11 AS jb-builder | ||
ARG JSONNET_BUNDLER_VERSION=0.4.0 | ||
ARG JSONNET_BUNDLER_CHECKSUM="433edab5554a88a0371e11e93080408b225d41c31decf321c02b50d2e44993ce /usr/bin/jb" | ||
RUN apk add --no-cache curl | ||
RUN curl -fSL -o "/usr/bin/jb" "https://github.com/jsonnet-bundler/jsonnet-bundler/releases/download/v${JSONNET_BUNDLER_VERSION}/jb-linux-amd64" | ||
RUN echo "${JSONNET_BUNDLER_CHECKSUM}" | sha256sum -c || (printf "wanted: %s\n got: %s\n" "${JSONNET_BUNDLER_CHECKSUM}" "$(sha256sum /usr/bin/jb)"; exit 1) | ||
RUN chmod +x /usr/bin/jb | ||
|
||
# Build mixtool | ||
FROM golang:1.15-alpine AS mixtool-builder | ||
RUN GO111MODULE=on go get github.com/monitoring-mixins/mixtool/cmd/mixtool@59d44357240d | ||
|
||
FROM alpine:3.7 | ||
RUN apk --no-cache add make python git openssh-client | ||
COPY --from=0 jsonnet/jsonnet /usr/bin | ||
COPY --from=0 jsonnet/jsonnetfmt /usr/bin | ||
RUN apk --no-cache add make python git openssh-client bash | ||
COPY --from=jsonnet-builder jsonnet/jsonnet /usr/bin | ||
COPY --from=jsonnet-builder jsonnet/jsonnetfmt /usr/bin | ||
COPY --from=jb-builder /usr/bin/jb /urs/bin | ||
COPY --from=mixtool-builder /go/bin/mixtool /usr/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.uptodate: Dockerfile | ||
docker build -t grafana/jsonnet-build:$(shell git rev-parse --short HEAD) . | ||
touch $@ | ||
|
||
publish-build-image: | ||
docker push grafana/jsonnet-build:$(shell git rev-parse --short HEAD) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
{ | ||
"dependencies": [ | ||
{ | ||
"name": "grafana-builder", | ||
"source": { | ||
"git": { | ||
"remote": "https://github.com/grafana/jsonnet-libs", | ||
"subdir": "grafana-builder" | ||
} | ||
}, | ||
"version": "master" | ||
"version": 1, | ||
"dependencies": [ | ||
{ | ||
"source": { | ||
"git": { | ||
"remote": "https://github.com/grafana/jsonnet-libs.git", | ||
"subdir": "grafana-builder" | ||
} | ||
] | ||
}, | ||
"version": "master" | ||
} | ||
], | ||
"legacyImports": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"version": 1, | ||
"dependencies": [ | ||
{ | ||
"source": { | ||
"git": { | ||
"remote": "https://github.com/grafana/jsonnet-libs.git", | ||
"subdir": "grafana-builder" | ||
} | ||
}, | ||
"version": "master" | ||
} | ||
], | ||
"legacyImports": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
{ | ||
"dependencies": [ | ||
{ | ||
"name": "grafana-builder", | ||
"source": { | ||
"git": { | ||
"remote": "https://github.com/grafana/jsonnet-libs", | ||
"subdir": "grafana-builder" | ||
} | ||
}, | ||
"version": "master" | ||
"version": 1, | ||
"dependencies": [ | ||
{ | ||
"source": { | ||
"git": { | ||
"remote": "https://github.com/grafana/jsonnet-libs.git", | ||
"subdir": "grafana-builder" | ||
} | ||
] | ||
}, | ||
"version": "master" | ||
} | ||
], | ||
"legacyImports": true | ||
} |