From c84c5749289cc6919b85a8b8596da2d2db9c6331 Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Tue, 18 Jan 2022 18:03:21 +0000 Subject: [PATCH] Run lint as part of the docker build. --- .buildkite/lint.sh | 2 +- Dockerfile | 4 ++++ scripts/lint.sh | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.buildkite/lint.sh b/.buildkite/lint.sh index 73a48c0..f9be9b5 100755 --- a/.buildkite/lint.sh +++ b/.buildkite/lint.sh @@ -8,4 +8,4 @@ go get golang.org/x/lint/golint go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow go get github.com/fzipp/gocyclo/cmd/gocyclo -./scripts/lint.sh +/bin/sh ./scripts/lint.sh diff --git a/Dockerfile b/Dockerfile index 093e8c5..74b768b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,11 @@ COPY go.mod . COPY go.sum . RUN go mod download + COPY . . + +RUN CGO_ENABLED=0 sh .buildkite/lint.sh + RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o rageshake FROM scratch diff --git a/scripts/lint.sh b/scripts/lint.sh index 482a4af..0fbed92 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # check the go source for lint. This is run by CI, and the pre-commit hook.