Skip to content

Commit 663366a

Browse files
Merge pull request #160 from TransactionProcessing/task/#159_createwindowsimage
Create a windows image
2 parents d82f58f + 618e018 commit 663366a

8 files changed

Lines changed: 78 additions & 1 deletion

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
name: "Release"
10+
env:
11+
ASPNETCORE_ENVIRONMENT: "Production"
12+
13+
runs-on: windows-2019
14+
15+
steps:
16+
- uses: actions/checkout@v2.3.4
17+
18+
- name: Get the version
19+
id: get_version
20+
uses: battila7/get-version-action@v2
21+
22+
- name: Publish Images to Docker Hub - Pre Release
23+
if: ${{ github.event.release.prerelease == true }}
24+
run: |
25+
docker build . --file TransactionProcessorACL/Dockerfilewindows --tag stuartferguson/transactionprocessoraclwindows:dev
26+
docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
27+
docker push stuartferguson/transactionprocessoraclwindows:dev
28+
29+
- name: Publish Images to Docker Hub - Formal Release
30+
if: ${{ github.event.release.prerelease == false }}
31+
run: |
32+
docker build . --file TransactionProcessorACL/Dockerfilewindows --tag stuartferguson/transactionprocessoraclwindows:latest
33+
docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
34+
docker push stuartferguson/transactionprocessoraclwindows:latest

.github/workflows/pushtomaster.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,20 @@ jobs:
5050
docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
5151
docker push stuartferguson/transactionprocessoracl:master
5252
53+
buildwidows:
54+
name: "Publish Pre-Release Docker for Windows"
55+
env:
56+
ASPNETCORE_ENVIRONMENT: "Production"
57+
58+
runs-on: windows-2019
5359

60+
steps:
61+
- uses: actions/checkout@v2.3.4
62+
with:
63+
fetch-depth: 0
64+
65+
- name: Publish Windows Images to Docker Hub
66+
run: |
67+
docker build . --file TransactionProcessorACL/Dockerfilewindows --tag stuartferguson/transactionprocessoraclwindows:master
68+
docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
69+
docker push stuartferguson/transactionprocessoraclwindows:master

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ ClientBin/
218218
*.dbmdl
219219
*.dbproj.schemaview
220220
*.jfm
221-
*.pfx
221+
#*.pfx
222222
*.publishsettings
223223
orleans.codegen.cs
224224

3.5 KB
Binary file not shown.
820 Bytes
Binary file not shown.
2.6 KB
Binary file not shown.

Certificates/aspnetapp-web-api.pfx

3.47 KB
Binary file not shown.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM stuartferguson/txnprocbasewindows AS base
2+
USER ContainerAdministrator
3+
WORKDIR /app
4+
5+
FROM mcr.microsoft.com/dotnet/sdk:6.0-windowsservercore-ltsc2019 AS build
6+
WORKDIR /src
7+
COPY ["TransactionProcessorACL/NuGet.Config", "."]
8+
COPY ["TransactionProcessorACL/TransactionProcessorACL.csproj", "TransactionProcessorACL/"]
9+
COPY ["TransactionProcessorACL.DataTransferObjects/TransactionProcessorACL.DataTransferObjects.csproj", "TransactionProcessorACL.DataTransferObjects/"]
10+
COPY ["TransactionProcessorACL.BusinessLogic/TransactionProcessorACL.BusinessLogic.csproj", "TransactionProcessorACL.BusinessLogic/"]
11+
COPY ["TransactionProcessorACL.Models/TransactionProcessorACL.Models.csproj", "TransactionProcessorACL.Models/"]
12+
RUN dotnet restore "TransactionProcessorACL/TransactionProcessorACL.csproj"
13+
COPY . .
14+
WORKDIR "/src/TransactionProcessorACL"
15+
RUN dotnet build "TransactionProcessorACL.csproj" -c Release -o /app/build
16+
17+
WORKDIR "/src"
18+
RUN %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\powershell.exe -Command Import-PfxCertificate -FilePath "Certificates/aspnetapp-root-cert.pfx" -Password (ConvertTo-SecureString -String 'password' -AsPlainText -Force) -CertStoreLocation Cert:\LocalMachine\Root
19+
20+
WORKDIR "/src/TransactionProcessorACL"
21+
FROM build AS publish
22+
RUN dotnet publish "TransactionProcessorACL.csproj" -c Release -o /app/publish
23+
24+
FROM base AS final
25+
WORKDIR /app
26+
COPY --from=publish /app/publish .
27+
ENTRYPOINT ["dotnet", "TransactionProcessorACL.dll"]

0 commit comments

Comments
 (0)