Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
waterfoul committed Jul 20, 2023
1 parent f0a05a3 commit 43d9378
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 67 deletions.
30 changes: 14 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ FROM mvdan/shfmt:latest-alpine as shfmt
FROM hadolint/hadolint:v2.12.0-alpine as hadolint
FROM mstruebing/editorconfig-checker:2.7.0 as editorconfig-checker
FROM dotenvlinter/dotenv-linter:latest as dotenvlinter
FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
## The golang image used as a builder is a temporary workaround
## for the released revive binaries not returning version numbers (devel).
## The install command should then be what is commented in the go.megalinter-descriptor.yml
RUN mkdir temp && cd temp && go mod init temp && go get -d github.com/mgechev/revive@latest
ARG BUILDARCH
ARG TARGETARCH
RUN GOOS=linux GOARCH=${TARGETARCH} go install github.com/mgechev/revive@latest \
&& ([[ "${BUILDARCH}" == "${TARGETARCH}" ]] && mv bin/revive /usr/bin) || mv bin/linux_${TARGETARCH}/revive /usr/bin
FROM golang:1-alpine as revive
COPY --from=revive-build /usr/bin/revive /usr/bin/revive
# Verify Binary
RUN /usr/bin/revive --version

FROM ghcr.io/yannh/kubeconform:latest-alpine as kubeconform
FROM ghcr.io/assignuser/chktex-alpine:latest as chktex
FROM mrtazz/checkmake:latest as checkmake
Expand Down Expand Up @@ -850,22 +864,6 @@ esac \
&& wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh \
&& golangci-lint --version

#
# revive installation
## The golang image used as a builder is a temporary workaround
## for the released revive binaries not returning version numbers (devel).
## The install command should then be what is commented in the go.megalinter-descriptor.yml
FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
RUN mkdir temp && cd temp && go mod init temp && go get -d github.com/mgechev/revive@latest
ARG BUILDARCH
ARG TARGETARCH
RUN GOOS=linux GOARCH=${TARGETARCH} go install github.com/mgechev/revive@latest \
&& ([[ "${BUILDARCH}" == "${TARGETARCH}" ]] && mv bin/revive /usr/bin) || mv bin/linux_${TARGETARCH}/revive /usr/bin
FROM golang:1-alpine as revive
COPY --from=revive-build /usr/bin/revive /usr/bin/revive
# Verify Binary
RUN /usr/bin/revive --version

#
# checkstyle installation
RUN --mount=type=secret,id=GITHUB_TOKEN CHECKSTYLE_LATEST=$(curl -s \
Expand Down
30 changes: 14 additions & 16 deletions flavors/cupcake/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ FROM mvdan/shfmt:latest-alpine as shfmt
FROM hadolint/hadolint:v2.12.0-alpine as hadolint
FROM mstruebing/editorconfig-checker:2.7.0 as editorconfig-checker
FROM dotenvlinter/dotenv-linter:latest as dotenvlinter
FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
## The golang image used as a builder is a temporary workaround
## for the released revive binaries not returning version numbers (devel).
## The install command should then be what is commented in the go.megalinter-descriptor.yml
RUN mkdir temp && cd temp && go mod init temp && go get -d github.com/mgechev/revive@latest
ARG BUILDARCH
ARG TARGETARCH
RUN GOOS=linux GOARCH=${TARGETARCH} go install github.com/mgechev/revive@latest \
&& ([[ "${BUILDARCH}" == "${TARGETARCH}" ]] && mv bin/revive /usr/bin) || mv bin/linux_${TARGETARCH}/revive /usr/bin
FROM golang:1-alpine as revive
COPY --from=revive-build /usr/bin/revive /usr/bin/revive
# Verify Binary
RUN /usr/bin/revive --version

FROM ghcr.io/yannh/kubeconform:latest-alpine as kubeconform
FROM mrtazz/checkmake:latest as checkmake
FROM ghcr.io/phpstan/phpstan:latest-php8.1 as phpstan
Expand Down Expand Up @@ -634,22 +648,6 @@ RUN curl --retry 5 --retry-delay 5 -sLO https://raw.githubusercontent.com/clj-ko
&& wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh \
&& golangci-lint --version

#
# revive installation
## The golang image used as a builder is a temporary workaround
## for the released revive binaries not returning version numbers (devel).
## The install command should then be what is commented in the go.megalinter-descriptor.yml
FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
RUN mkdir temp && cd temp && go mod init temp && go get -d github.com/mgechev/revive@latest
ARG BUILDARCH
ARG TARGETARCH
RUN GOOS=linux GOARCH=${TARGETARCH} go install github.com/mgechev/revive@latest \
&& ([[ "${BUILDARCH}" == "${TARGETARCH}" ]] && mv bin/revive /usr/bin) || mv bin/linux_${TARGETARCH}/revive /usr/bin
FROM golang:1-alpine as revive
COPY --from=revive-build /usr/bin/revive /usr/bin/revive
# Verify Binary
RUN /usr/bin/revive --version

#
# checkstyle installation
RUN --mount=type=secret,id=GITHUB_TOKEN CHECKSTYLE_LATEST=$(curl -s \
Expand Down
35 changes: 16 additions & 19 deletions flavors/go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ FROM mvdan/shfmt:latest-alpine as shfmt
FROM hadolint/hadolint:v2.12.0-alpine as hadolint
FROM mstruebing/editorconfig-checker:2.7.0 as editorconfig-checker
FROM dotenvlinter/dotenv-linter:latest as dotenvlinter
FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
## The golang image used as a builder is a temporary workaround
## for the released revive binaries not returning version numbers (devel).
## The install command should then be what is commented in the go.megalinter-descriptor.yml
RUN mkdir temp && cd temp && go mod init temp && go get -d github.com/mgechev/revive@latest
ARG BUILDARCH
ARG TARGETARCH
RUN GOOS=linux GOARCH=${TARGETARCH} go install github.com/mgechev/revive@latest \
&& ([[ "${BUILDARCH}" == "${TARGETARCH}" ]] && mv bin/revive /usr/bin) || mv bin/linux_${TARGETARCH}/revive /usr/bin
FROM golang:1-alpine as revive
COPY --from=revive-build /usr/bin/revive /usr/bin/revive
# Verify Binary
RUN /usr/bin/revive --version

FROM ghcr.io/yannh/kubeconform:latest-alpine as kubeconform
FROM mrtazz/checkmake:latest as checkmake
FROM yoheimuta/protolint:latest as protolint
Expand Down Expand Up @@ -392,27 +406,10 @@ COPY --from=copy-collector / /
#OTHER__START
# golangci-lint installation
RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh \
&& golangci-lint --version

#
# revive installation
## The golang image used as a builder is a temporary workaround
## for the released revive binaries not returning version numbers (devel).
## The install command should then be what is commented in the go.megalinter-descriptor.yml
FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
RUN mkdir temp && cd temp && go mod init temp && go get -d github.com/mgechev/revive@latest
ARG BUILDARCH
ARG TARGETARCH
RUN GOOS=linux GOARCH=${TARGETARCH} go install github.com/mgechev/revive@latest \
&& ([[ "${BUILDARCH}" == "${TARGETARCH}" ]] && mv bin/revive /usr/bin) || mv bin/linux_${TARGETARCH}/revive /usr/bin
FROM golang:1-alpine as revive
COPY --from=revive-build /usr/bin/revive /usr/bin/revive
# Verify Binary
RUN /usr/bin/revive --version

&& golangci-lint --version \
#
# ktlint installation
RUN curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
&& curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
chmod a+x ktlint && \
mv "ktlint" /usr/bin/ \
#
Expand Down
28 changes: 13 additions & 15 deletions linters/go_revive/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@
## @generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
#FROM__START
FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
## The golang image used as a builder is a temporary workaround
## for the released revive binaries not returning version numbers (devel).
## The install command should then be what is commented in the go.megalinter-descriptor.yml
RUN mkdir temp && cd temp && go mod init temp && go get -d github.com/mgechev/revive@latest
ARG BUILDARCH
ARG TARGETARCH
RUN GOOS=linux GOARCH=${TARGETARCH} go install github.com/mgechev/revive@latest \
&& ([[ "${BUILDARCH}" == "${TARGETARCH}" ]] && mv bin/revive /usr/bin) || mv bin/linux_${TARGETARCH}/revive /usr/bin
FROM golang:1-alpine as revive
COPY --from=revive-build /usr/bin/revive /usr/bin/revive
# Verify Binary
RUN /usr/bin/revive --version

#FROM__END

Expand Down Expand Up @@ -215,22 +228,7 @@ COPY --from=copy-collector / /
## @generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
#OTHER__START
# revive installation
## The golang image used as a builder is a temporary workaround
## for the released revive binaries not returning version numbers (devel).
## The install command should then be what is commented in the go.megalinter-descriptor.yml
FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
RUN mkdir temp && cd temp && go mod init temp && go get -d github.com/mgechev/revive@latest
ARG BUILDARCH
ARG TARGETARCH
RUN GOOS=linux GOARCH=${TARGETARCH} go install github.com/mgechev/revive@latest \
&& ([[ "${BUILDARCH}" == "${TARGETARCH}" ]] && mv bin/revive /usr/bin) || mv bin/linux_${TARGETARCH}/revive /usr/bin
FROM golang:1-alpine as revive
COPY --from=revive-build /usr/bin/revive /usr/bin/revive
# Verify Binary
RUN /usr/bin/revive --version

#
#OTHER__END

###########################
Expand Down
2 changes: 1 addition & 1 deletion megalinter/descriptors/go.megalinter-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ linters:
# - FROM ghcr.io/mgechev/revive:1.2.5 as revive
# - COPY --link --from=revive /usr/bin/revive /usr/bin/revive
- |
FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
## The golang image used as a builder is a temporary workaround
## for the released revive binaries not returning version numbers (devel).
## The install command should then be what is commented in the go.megalinter-descriptor.yml
FROM --platform=$BUILDPLATFORM golang:1-alpine as revive-build
RUN mkdir temp && cd temp && go mod init temp && go get -d github.com/mgechev/revive@latest
ARG BUILDARCH
ARG TARGETARCH
Expand Down

0 comments on commit 43d9378

Please sign in to comment.