2019-11-21 12:05:51 +00:00
|
|
|
FROM golang:1.13.4-alpine as build
|
|
|
|
RUN mkdir -p /go/src/github.com/aosapps/drone-sonar-plugin
|
|
|
|
WORKDIR /go/src/github.com/aosapps/drone-sonar-plugin
|
|
|
|
COPY *.go ./
|
|
|
|
COPY vendor ./vendor/
|
|
|
|
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o drone-sonar
|
|
|
|
|
2020-10-13 12:44:51 +00:00
|
|
|
FROM openjdk:8-jre-alpine
|
2018-08-28 16:39:09 +00:00
|
|
|
|
2020-10-13 12:44:51 +00:00
|
|
|
ARG SONAR_VERSION=4.5.0.2216
|
2019-02-12 10:17:23 +00:00
|
|
|
ARG SONAR_SCANNER_CLI=sonar-scanner-cli-${SONAR_VERSION}
|
|
|
|
ARG SONAR_SCANNER=sonar-scanner-${SONAR_VERSION}
|
|
|
|
|
|
|
|
RUN apk add --no-cache --update nodejs curl
|
2019-11-21 12:05:51 +00:00
|
|
|
COPY --from=build /go/src/github.com/aosapps/drone-sonar-plugin/drone-sonar /bin/
|
2018-08-28 16:39:09 +00:00
|
|
|
WORKDIR /bin
|
|
|
|
|
2019-02-12 10:17:23 +00:00
|
|
|
RUN curl https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/${SONAR_SCANNER_CLI}.zip -so /bin/${SONAR_SCANNER_CLI}.zip
|
|
|
|
RUN unzip ${SONAR_SCANNER_CLI}.zip \
|
|
|
|
&& rm ${SONAR_SCANNER_CLI}.zip \
|
|
|
|
&& apk del curl
|
|
|
|
|
|
|
|
ENV PATH $PATH:/bin/${SONAR_SCANNER}/bin
|
2018-08-28 16:39:09 +00:00
|
|
|
|
|
|
|
ENTRYPOINT /bin/drone-sonar
|