Merge pull request #10 from TelluIoT/master
🐳 The drone-sonar binary is compiled using a multi-stage docker build
This commit is contained in:
commit
15157105c5
@ -1,3 +1,10 @@
|
|||||||
|
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
|
||||||
|
|
||||||
FROM openjdk:8-jre-alpine
|
FROM openjdk:8-jre-alpine
|
||||||
|
|
||||||
ARG SONAR_VERSION=4.2.0.1873
|
ARG SONAR_VERSION=4.2.0.1873
|
||||||
@ -5,7 +12,7 @@ ARG SONAR_SCANNER_CLI=sonar-scanner-cli-${SONAR_VERSION}
|
|||||||
ARG SONAR_SCANNER=sonar-scanner-${SONAR_VERSION}
|
ARG SONAR_SCANNER=sonar-scanner-${SONAR_VERSION}
|
||||||
|
|
||||||
RUN apk add --no-cache --update nodejs curl
|
RUN apk add --no-cache --update nodejs curl
|
||||||
COPY drone-sonar /bin/
|
COPY --from=build /go/src/github.com/aosapps/drone-sonar-plugin/drone-sonar /bin/
|
||||||
WORKDIR /bin
|
WORKDIR /bin
|
||||||
|
|
||||||
RUN curl https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/${SONAR_SCANNER_CLI}.zip -so /bin/${SONAR_SCANNER_CLI}.zip
|
RUN curl https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/${SONAR_SCANNER_CLI}.zip -so /bin/${SONAR_SCANNER_CLI}.zip
|
||||||
|
BIN
drone-sonar
BIN
drone-sonar
Binary file not shown.
Loading…
Reference in New Issue
Block a user