Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get-latest-gbt-version #15

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ FROM go as tools
RUN env GOBIN=/build go install github.com/grafana/grizzly/cmd/grr@5f301fd6c773
# RUN env GOBIN=/build go install github.com/grafana/grizzly/cmd/[email protected]

# Add semversort
RUN env GOBIN=/build go install github.com/whereswaldon/[email protected]

# Add golangci-lint
COPY --from=registry.hub.docker.com/golangci/golangci-lint:v1.55.2 /usr/bin/golangci-lint /build

Expand All @@ -55,6 +58,9 @@ FROM go as tools
# Add gotestsum
RUN env GOBIN=/build go install gotest.tools/[email protected]

# Add jq
COPY --from=ghcr.io/jqlang/jq:1.7 /jq /build

FROM go AS k6
# The grafana/xk6 image only exists for amd64, so we need to build it for
# the target architecture.
Expand Down Expand Up @@ -114,3 +120,5 @@ FROM registry.hub.docker.com/library/debian:stable-slim AS final
COPY --from=skopeo /build/* /usr/local/bin/

COPY lib/image-test /usr/local/bin

COPY lib/get-latest-gbt-version /usr/local/bin
6 changes: 6 additions & 0 deletions lib/get-latest-gbt-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

skopeo list-tags docker://ghcr.io/grafana/grafana-build-tools |
jq -r '.Tags[] | select(. | startswith("v"))' |
semversort |
tail -1
9 changes: 9 additions & 0 deletions lib/image-test
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ mage -version
echo '=== nilaway'
nilaway -help

echo '=== semversort'
semversort < /dev/null

echo '=== grr'
grr --version

Expand All @@ -63,6 +66,9 @@ git-chglog --help
echo '=== gotestsum'
gotestsum --version

echo '=== jq'
jq --version

echo '=== gcc'
gcc --version

Expand All @@ -79,3 +85,6 @@ pkg-config --version

echo '=== skopeo'
skopeo --version

echo '=== get-latest-gbt-version'
command -v get-latest-gbt-version