Skip to content

Commit

Permalink
docker test 1
Browse files Browse the repository at this point in the history
  • Loading branch information
AxelLofberg committed Jan 17, 2024
1 parent e31202e commit 0efcf31
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/grupp7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Run unit test on merge publish Docker image


on:
pull_request:
push:
branches:
- '*'
- axelsbranch

jobs:
build:
Expand Down
21 changes: 14 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
# Använd ett .NET Core SDK-baserat image för att bygga och testa
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /app
#FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
#WORKDIR /app

# Kopiera allt från projektet till arbetskatalogen
COPY . .
# COPY . .

# Bygg applikationen
RUN dotnet build -c Release
# RUN dotnet build -c Release

# Kör xUnit-tester
RUN dotnet test
# RUN dotnet test

# Ange arbetskatalogen för att köra applikationen
WORKDIR /app/bin/Release/net8.0
# WORKDIR /app/bin/Release/net8.0

# Ange entrypoint för att köra applikationen
CMD ["dotnet", "gruppuppgiftCI_CD.dll"]
# CMD ["dotnet", "gruppuppgiftCI_CD.dll"]

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env

WORKDIR /app

COPY ./bin/Debug/net8.0/ .

CMD ["dotnet", "gruppuppgiftCI_CD.dll"]
1 change: 1 addition & 0 deletions Personummer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public static bool Validera(string personnummer)
}
}


// Ytterligare kontroller för personnummer kan läggas till här.

return true;
Expand Down

0 comments on commit 0efcf31

Please sign in to comment.