-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.Dockerfile
More file actions
34 lines (25 loc) · 852 Bytes
/
test.Dockerfile
File metadata and controls
34 lines (25 loc) · 852 Bytes
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
FROM microsoft/dotnet:2.2-sdk AS build
LABEL Maintainer "Calvin Rodo"
WORKDIR /app
# copy csproj and restore as distinct layers
COPY webpoc/*.csproj ./webpoc/
WORKDIR /app/webpoc
RUN dotnet restore
# copy and publish app and libraries
WORKDIR /app/
COPY webpoc/. ./webpoc/
WORKDIR /app/webpoc
RUN dotnet publish -c Release -o out
# test application -- see: dotnet-docker-unit-testing.md
FROM build AS testrunner
WORKDIR /app/webpoctest
RUN dotnet tool install coverlet.console --tool-path /app/tools/
COPY webpoctest/. .
RUN dotnet test
ENTRYPOINT ["/app/tools/coverlet", \
"/app/webpoctest/bin/Debug/netcoreapp2.0/webpoctest.dll", \
"--target", "dotnet", \
"--targetargs", "test --no-build", \
"--format", "json", \
"--output", "/app/test-results/codecoverage"]
# ENTRYPOINT ["dotnet", "test", "--logger:trx", "/p:CollectCoverage=true"]