Skip to content

Commit

Permalink
WIP - Testing approaches
Browse files Browse the repository at this point in the history
  • Loading branch information
mvelosop committed Apr 10, 2019
1 parent aa7614b commit f6c2f56
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 16 deletions.
10 changes: 8 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
docker-compose*.yml
docker-compose.dcproj
*.sln
!eShopOnContainers-ServicesAndWebApps.sln
*.md
hosts
LICENSE
Expand All @@ -31,4 +30,11 @@ cli-linux
**/wwwroot/lib/*
global.json
**/appsettings.localhost.json
src/Web/WebSPA/wwwroot/
src/Web/WebSPA/wwwroot/
packages/
csproj-files/
test-results/
TestResults/
src/Mobile/
src/Web/Catalog.WebForms/
src/Web/WebMonolithic/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ bld/
# Visual Studio 2015 cache/options directory
.vs/

# Dockerfile projects folder for restore-packages script
csproj-files/

# .js files created on build:
src/Web/WebMVC/wwwroot/js/site*

Expand Down
3 changes: 3 additions & 0 deletions Dockerfile-scripts/restore-packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

for f in *.csproj; do dotnet restore --no-dependencies ../csproj-files/$f; done
1 change: 1 addition & 0 deletions restore-packages.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
for /R %%f in (*.csproj) do dotnet restore --no-dependencies %%f
31 changes: 17 additions & 14 deletions src/Services/Ordering/Ordering.API/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,24 @@ EXPOSE 80

FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build
WORKDIR /src
COPY . .
WORKDIR /src/src/Services/Ordering/Ordering.API
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build --no-restore -c Release -o /app
COPY **/*.csproj csproj-files/
# WORKDIR /src/Dockerfile-scripts
# RUN restore-packages
# COPY . .
# WORKDIR /src/src/Services/Ordering/Ordering.API
# RUN dotnet restore -nowarn:msb3202,nu1503
# RUN dotnet build --no-restore -c Release -o /app

FROM build as functionaltest
WORKDIR /src/src/Services/Ordering/Ordering.FunctionalTests
# FROM build as functionaltest
# WORKDIR /src/src/Services/Ordering/Ordering.FunctionalTests

FROM build as unittest
WORKDIR /src/src/Services/Ordering/Ordering.UnitTests
# FROM build as unittest
# WORKDIR /src/src/Services/Ordering/Ordering.UnitTests

FROM build AS publish
RUN dotnet publish --no-restore -c Release -o /app
# FROM build AS publish
# RUN dotnet publish --no-restore -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "Ordering.API.dll"]
# FROM base AS final
# WORKDIR /app
# COPY --from=publish /app .
# ENTRYPOINT ["dotnet", "Ordering.API.dll"]

0 comments on commit f6c2f56

Please sign in to comment.