This repository was archived by the owner on Mar 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (34 loc) · 1.24 KB
/
Dockerfile
File metadata and controls
43 lines (34 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# This is the docker file for CI builds of Factorino
FROM microsoft/dotnet:2.2-sdk AS build-env
WORKDIR /app
# We need a token for this build
ARG sonarcloud_token
# The SonarQube scanner need java..
RUN apt-get update && apt-get -yq install openjdk-8-jre
# ..and node for analysing CSS files..
RUN apt-get update -yq \
&& apt-get install curl gnupg -yq \
&& curl -sL https://deb.nodesource.com/setup_8.x | bash \
&& apt-get install nodejs -yq
# Install tools
RUN dotnet tool install --global dotnet-sonarscanner
ENV PATH="${PATH}:/root/.dotnet/tools"
# Copy everything
COPY . ./
# Init SonarCloud analysis
RUN dotnet sonarscanner begin \
/k:"TobbenTM_Factorino" \
/o:"tobbentm-github" \
/d:sonar.host.url="https://sonarcloud.io" \
/d:sonar.login="$sonarcloud_token" \
/d:sonar.language="cs" \
/d:sonar.exclusions="**/bin/**/*,**/obj/**/*,**/vendor/**/*,**/dist/**/*,**/node_modules/**/*" \
/d:sonar.coverage.exclusions="test/**" \
/d:sonar.sourceEncoding="UTF-8" \
/d:sonar.cs.opencover.reportsPaths="/app/coverage/coverage.opencover.xml"
# Build and test
RUN dotnet restore
RUN dotnet build
RUN bash test.sh
# Finish analysis
RUN dotnet sonarscanner end /d:sonar.login="$sonarcloud_token"