Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/buildwindowsimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
- name: Publish Images to Docker Hub - Pre Release
if: ${{ github.event.release.prerelease == true }}
run: |
docker build . --file MessagingService/Dockerfilewindows --tag stuartferguson/messagingservicewindows:dev
docker build . --file MessagingService/Dockerfilewindows --tag stuartferguson/messagingservicewindows:dev --build-arg NUGET_TOKEN=${{ secrets.PRIVATEFEED_APIKEY }}
docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
docker push stuartferguson/messagingservicewindows:dev
- name: Publish Images to Docker Hub - Formal Release
if: ${{ github.event.release.prerelease == false }}
run: |
docker build . --file MessagingService/Dockerfilewindows --tag stuartferguson/messagingservicewindows:latest
docker build . --file MessagingService/Dockerfilewindows --tag stuartferguson/messagingservicewindows:latest --build-arg NUGET_TOKEN=${{ secrets.PRIVATEFEED_APIKEY }}
docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
docker push stuartferguson/messagingservicewindows:latest
12 changes: 7 additions & 5 deletions .github/workflows/createrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ jobs:
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Restore Nuget Packages
run: dotnet restore MessagingService.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json
env:
GITHUBTOKEN: ${{ secrets.PRIVATEFEED_APIKEY }}
run: dotnet restore MessagingService.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}

- name: Build Code
run: dotnet build MessagingService.sln --configuration Release
Expand All @@ -35,14 +37,14 @@ jobs:
- name: Publish Images to Docker Hub - Pre Release
if: ${{ github.event.release.prerelease == true }}
run: |
docker build . --file MessagingService/Dockerfile --tag stuartferguson/messagingservice:dev
docker build . --file MessagingService/Dockerfile --tag stuartferguson/messagingservice:dev --build-arg NUGET_TOKEN=${{ secrets.PRIVATEFEED_APIKEY }}
docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
docker push stuartferguson/messagingservice:dev

- name: Publish Images to Docker Hub - Formal Release
if: ${{ github.event.release.prerelease == false }}
run: |
docker build . --file MessagingService/Dockerfile --tag stuartferguson/messagingservice:latest
docker build . --file MessagingService/Dockerfile --tag stuartferguson/messagingservice:latest --build-arg NUGET_TOKEN=${{ secrets.PRIVATEFEED_APIKEY }}
docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
docker push stuartferguson/messagingservice:latest

Expand Down Expand Up @@ -114,6 +116,6 @@ jobs:
if: ${{ github.event.release.prerelease == false }}
run: |
dotnet pack "MessagingService.Client\MessagingService.Client.csproj" /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} --output Nugets -c Release
dotnet nuget push Nugets/MessagingService.Client.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.MYGET_APIKEY }} --source https://www.myget.org/F/transactionprocessing/api/v2/package
dotnet nuget push Nugets/MessagingService.Client.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.PRIVATEFEED_APIKEY }} --source ${{ secrets.PRIVATEFEED_URL }}
dotnet pack "MessagingService.EmailMessage.DomainEvents\MessagingService.EmailMessage.DomainEvents.csproj" /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} --output Nugets -c Release
dotnet nuget push Nugets/MessagingService.EmailMessage.DomainEvents.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.MYGET_APIKEY }} --source https://www.myget.org/F/transactionprocessing/api/v2/package
dotnet nuget push Nugets/MessagingService.EmailMessage.DomainEvents.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.PRIVATEFEED_APIKEY }} --source ${{ secrets.PRIVATEFEED_URL }}
6 changes: 4 additions & 2 deletions .github/workflows/nightlybuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ jobs:
run: echo "action_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV

- name: Restore Nuget Packages
run: dotnet restore MessagingService.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json
env:
GITHUBTOKEN: ${{ secrets.PRIVATEFEED_APIKEY }}
run: dotnet restore MessagingService.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}

- name: Build Code
run: dotnet build MessagingService.sln --configuration Release
Expand All @@ -68,7 +70,7 @@ jobs:
files: ./lcov1.info,./lcov2.info,./lcov3.info,./lcov4.info

- name: Build Docker Image
run: docker build . --file MessagingService/Dockerfile --tag messagingservice:latest
run: docker build . --file MessagingService/Dockerfile --tag messagingservice:latest --build-arg NUGET_TOKEN=${{ secrets.PRIVATEFEED_APIKEY }}

- name: Run Integration Tests
run: dotnet test "MessagingService.IntegrationTests\MessagingService.IntegrationTests.csproj"
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:
- uses: actions/checkout@v2.3.4

- name: Restore Nuget Packages
run: dotnet restore MessagingService.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json
env:
GITHUBTOKEN: ${{ secrets.PRIVATEFEED_APIKEY }}
run: dotnet restore MessagingService.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}

- name: Build Code
run: dotnet build MessagingService.sln --configuration Release
Expand All @@ -30,7 +32,9 @@ jobs:
dotnet test "MessagingService.Tests\MessagingService.Tests.csproj"

- name: Build Docker Image
run: docker build . --file MessagingService/Dockerfile --tag messagingservice:latest
env:
GITHUBTOKEN: ${{ secrets.PRIVATEFEED_APIKEY }}
run: docker build . --file MessagingService/Dockerfile --tag messagingservice:latest --build-arg NUGET_TOKEN=${{ secrets.PRIVATEFEED_APIKEY }}

- name: Run Integration Tests
run: dotnet test "MessagingService.IntegrationTests\MessagingService.IntegrationTests.csproj" --filter Category=PRTest
12 changes: 7 additions & 5 deletions .github/workflows/pushtomaster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ jobs:
fetch-depth: 0

- name: Restore Nuget Packages
run: dotnet restore MessagingService.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json
env:
GITHUBTOKEN: ${{ secrets.PRIVATEFEED_APIKEY }}
run: dotnet restore MessagingService.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}

- name: Build Code
run: dotnet build MessagingService.sln --configuration Release
Expand All @@ -45,13 +47,13 @@ jobs:
- name: Build and Publish Nuget Packages
run: |
dotnet pack "MessagingService.Client\MessagingService.Client.csproj" /p:PackageVersion=${{ steps.next_version.outputs.VERSION }} --output Nugets -c Release
dotnet nuget push Nugets/MessagingService.Client.${{ steps.next_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.MYGET_APIKEY }} --source https://www.myget.org/F/transactionprocessing/api/v2/package
dotnet nuget push Nugets/MessagingService.Client.${{ steps.next_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.PRIVATEFEED_APIKEY }} --source ${{ secrets.PRIVATEFEED_URL }}
dotnet pack "MessagingService.EmailMessage.DomainEvents\MessagingService.EmailMessage.DomainEvents.csproj" /p:PackageVersion=${{ steps.next_version.outputs.VERSION }} --output Nugets -c Release
dotnet nuget push Nugets/MessagingService.EmailMessage.DomainEvents.${{ steps.next_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.MYGET_APIKEY }} --source https://www.myget.org/F/transactionprocessing/api/v2/package
dotnet nuget push Nugets/MessagingService.EmailMessage.DomainEvents.${{ steps.next_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.PRIVATEFEED_APIKEY }} --source ${{ secrets.PRIVATEFEED_URL }}

- name: Publish Images to Docker Hub
run: |
docker build . --file MessagingService/Dockerfile --tag stuartferguson/messagingservice:master
docker build . --file MessagingService/Dockerfile --tag stuartferguson/messagingservice:master --build-arg NUGET_TOKEN=${{ secrets.PRIVATEFEED_APIKEY }}
docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
docker push stuartferguson/messagingservice:master

Expand All @@ -69,6 +71,6 @@ jobs:

- name: Publish Windows Images to Docker Hub
run: |
docker build . --file MessagingService/Dockerfilewindows --tag stuartferguson/messagingservicewindows:master
docker build . --file MessagingService/Dockerfilewindows --tag stuartferguson/messagingservicewindows:master --build-arg NUGET_TOKEN=${{ secrets.PRIVATEFEED_APIKEY }}
docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
docker push stuartferguson/messagingservicewindows:master
3 changes: 2 additions & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUBTOKEN: ${{ secrets.PRIVATEFEED_APIKEY }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"TransactionProcessing_Messaging" /o:"transactionprocessing" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
dotnet restore MessagingService.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json
dotnet restore MessagingService.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
dotnet build MessagingService.sln
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
2 changes: 1 addition & 1 deletion MessagingService.sln
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessagingService.SMSMessage
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessagingService.SMSAggregate.Tests", "MessagingService.SMSAggregate.Tests\MessagingService.SMSAggregate.Tests.csproj", "{883DEFD0-7DDB-4F79-9996-2279E71CAF5B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MessagingService.Models", "MessagingService.Models\MessagingService.Models.csproj", "{327FAE7D-AF25-4380-AA8B-9FF7FCF46FBB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessagingService.Models", "MessagingService.Models\MessagingService.Models.csproj", "{327FAE7D-AF25-4380-AA8B-9FF7FCF46FBB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
7 changes: 7 additions & 0 deletions MessagingService/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ FROM stuartferguson/txnprocbase AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build

# Set the ARG for your GitHub Secret
ARG NUGET_TOKEN

WORKDIR /src
COPY ["MessagingService/NuGet.Config", "."]
# Replace the placeholders in the NuGet.config file with the GitHub Secret
RUN sed -i "s|NUGET_TOKEN|${NUGET_TOKEN}|g" NuGet.Config

COPY ["MessagingService/MessagingService.csproj", "MessagingService/"]
COPY ["MessagingService.BusinessLogic/MessagingService.BusinessLogic.csproj", "MessagingService.BusinessLogic/"]
COPY ["MessagingService.EmailMessageAggregate/MessagingService.EmailMessageAggregate.csproj", "MessagingService.EmailMessageAggregate/"]
Expand Down
8 changes: 7 additions & 1 deletion MessagingService/Dockerfilewindows
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ FROM stuartferguson/txnprocbasewindows AS base
USER ContainerAdministrator
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:7.0-windowsservercore-ltsc2019 AS build
# Set the ARG for your GitHub Secret
ARG NUGET_TOKEN

WORKDIR /src
COPY ["MessagingService/NuGet.Config", "."]
# Replace the placeholders in the NuGet.config file with the GitHub Secret
RUN powershell -Command "(Get-Content C:\NuGet.config) -replace 'NUGET_TOKEN', '${env:NUGET_TOKEN}' | Set-Content C:\NuGet.config"

COPY ["MessagingService/NuGet.Config", "."]
COPY ["MessagingService/MessagingService.csproj", "MessagingService/"]
COPY ["MessagingService.BusinessLogic/MessagingService.BusinessLogic.csproj", "MessagingService.BusinessLogic/"]
Expand Down
10 changes: 8 additions & 2 deletions MessagingService/NuGet.Config
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Transaction Processing" value="https://www.myget.org/F/transactionprocessing/api/v3/index.json" />
<add key="GitHub" value="https://nuget.pkg.github.com/TransactionProcessing/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<packageSourceCredentials>
<GitHub>
<add key="Username" value="stuart_ferguson1development@outlook.com"/>
<add key="ClearTextPassword" value="NUGET_TOKEN" />
</GitHub>
</packageSourceCredentials>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
Expand All @@ -15,4 +21,4 @@
<add key="format" value="0" />
<add key="disabled" value="False" />
</packageManagement>
</configuration>
</configuration>
24 changes: 24 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="GitHub" value="https://nuget.pkg.github.com/TransactionProcessing/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<packageSourceCredentials>
<GitHub>
<add key="Username" value="stuart_ferguson1development@outlook.com"/>
<add key="ClearTextPassword" value="%GITHUBTOKEN%" />
</GitHub>
</packageSourceCredentials>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
<packageManagement>
<add key="format" value="0" />
<add key="disabled" value="False" />
</packageManagement>
</configuration>