commit dadb9f7a52a48a87150a7893ce97f0bffcd42496 Author: Thomas Bellembois Date: Thu Sep 15 11:26:16 2022 +0200 First commit. diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..f36d5f0 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,20 @@ +kind: pipeline +type: docker +name: build + +trigger: + event: + - push + +steps: + - name: docker-build + image: plugins/docker + settings: + dockerfile: Dockerfile + context: . + registry: hub.codefirst.iut.uca.fr + repo: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dronesonarplugin-dotnet6 + username: + from_secret: SECRET_REGISTRY_USERNAME + password: + from_secret: SECRET_REGISTRY_PASSWORD diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..10cc333 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM aosapps/drone-sonar-plugin AS base + +FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine + +COPY --from=base /bin/drone-sonar /bin/ +WORKDIR /bin + +RUN apk update && apk add openjdk11-jre nodejs && rm -rf /tmp/* /var/cache/apk/* + +RUN dotnet tool install --global dotnet-sonarscanner +RUN dotnet tool install --global dotnet-reportgenerator-globaltool + +ENV JAVA_HOME /usr/lib/jvm/default-jvm/ +ENV PATH ${PATH}:${JAVA_HOME}/bin +ENV PATH $PATH:/root/.dotnet/tools + +ENTRYPOINT /bin/drone-sonar \ No newline at end of file