Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #148 from TomaszKandula/stage
Browse files Browse the repository at this point in the history
merge: stage to master
  • Loading branch information
TomaszKandula authored Feb 3, 2024
2 parents d614ce7 + 65baac4 commit 37ca8fd
Show file tree
Hide file tree
Showing 176 changed files with 761 additions and 836 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/dev_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,21 @@ jobs:
steps:

- name: Checkout repository
uses: actions/checkout@v2.2.0
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Variable substitution appsettings file for Staging (NET Core)
uses: microsoft/variable-substitution@v1
uses: TomaszKandula/variable-substitution@v1.0.1
with:
files: ${{ github.workspace }}/InvoiceGenerator.WebApi/appsettings.Staging.json
files: ${{ github.workspace }}/InvoiceGenerator.Configuration/appsettings.Development.json
env:
ConnectionStrings.DbConnect: "${{ secrets.CONNECTIONSTRINGS__DBCONNECT_STAGE }}"
ConnectionStrings.DbConnectTest: "${{ secrets.CONNECTIONSTRINGS__DBCONNECT_TEST }}"
DbConnect: "${{ secrets.DBCONNECT_TEST }}"
AZ_Storage_ContainerName: "${{ secrets.STORAGE_CONTAINER_NAME_TEST }}"
AZ_Storage_ConnectionString: "${{ secrets.STORAGE_CONNECTION_STRING }}"

- name: Setup dotnet
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'

Expand All @@ -40,7 +41,7 @@ jobs:

- name: SonarQube begin scan dotnet
run: |
dotnet tool install --global dotnet-sonarscanner
dotnet tool install --global dotnet-sonarscanner --version 5.15.0
dotnet tool update dotnet-reportgenerator-globaltool -g
dotnet sonarscanner begin \
/k:${{ secrets.SONARQUBE_PROJECT_KEY_BE }} \
Expand Down
39 changes: 20 additions & 19 deletions .github/workflows/master_build_test_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ jobs:
steps:

- name: Checkout repository
uses: actions/checkout@v2.2.0
uses: actions/checkout@v4

- name: Semantic Release (install node.js)
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 14
node-version: 18

- name: Semantic Release (install dependencies)
run: |
npm install --global yarn
yarn install
- name: Semantic Release (process changes)
uses: cycjimmy/semantic-release-action@v2
uses: cycjimmy/semantic-release-action@v4.0.0
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
Expand All @@ -50,18 +50,19 @@ jobs:
steps:

- name: Checkout repository
uses: actions/checkout@v2.2.0
uses: actions/checkout@v4

- name: Variable substitution appsettings file for Staging (NET Core)
uses: microsoft/variable-substitution@v1
uses: TomaszKandula/variable-substitution@v1.0.1
with:
files: ${{ github.workspace }}/InvoiceGenerator.WebApi/appsettings.Staging.json
files: ${{ github.workspace }}/InvoiceGenerator.Configuration/appsettings.Production.json
env:
ConnectionStrings.DbConnect: "${{ secrets.CONNECTIONSTRINGS__DBCONNECT_STAGE }}"
ConnectionStrings.DbConnectTest: "${{ secrets.CONNECTIONSTRINGS__DBCONNECT_TEST }}"
DbConnect: "${{ secrets.DBCONNECT_PROD }}"
AZ_Storage_ContainerName: "${{ secrets.STORAGE_CONTAINER_NAME_PROD }}"
AZ_Storage_ConnectionString: "${{ secrets.STORAGE_CONNECTION_STRING }}"

- name: Production | Build Docker (prepare)
uses: azure/docker-login@v1
uses: azure/docker-login@v1.0.1
with:
login-server: ${{ secrets.DOCKER_REGISTRY_SERVER_URL }}
username: ${{ secrets.DOCKER_REGISTRY_SERVER_USERNAME }}
Expand All @@ -71,7 +72,7 @@ jobs:
run: docker build -f webapi.dockerfile -t ${{ secrets.DOCKER_REGISTRY_SERVER_URL }}/${{ secrets.DOCKER_REGISTRY_SERVER_USERNAME }}:backend-production-${{ github.sha }} .

- name: Production | Push Docker image (prepare)
uses: azure/docker-login@v1
uses: azure/docker-login@v1.0.1
with:
login-server: ${{ secrets.DOCKER_REGISTRY_SERVER_URL }}
username: ${{ secrets.DOCKER_REGISTRY_SERVER_USERNAME }}
Expand All @@ -84,10 +85,10 @@ jobs:
# Note: due to a budget constraints, we use separate Azure App Service for staging as the separate slots
# are unavailable for B1, B2 and B3 pricing tiers
- name: Production | Deploy to Azure Web App
uses: azure/webapps-deploy@v2
uses: azure/webapps-deploy@v3
if: needs.versioning.outputs.outputs2 == 'true'
with:
app-name: invoicegenerator-prod
app-name: invoicegenerator-production
slot-name: production
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE_BACKEND_PROD }}
images: ${{ secrets.DOCKER_REGISTRY_SERVER_URL }}/${{ secrets.DOCKER_REGISTRY_SERVER_USERNAME }}:backend-production-${{ github.sha }}
Expand All @@ -97,20 +98,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Log in to container registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY_SERVER_URL }}
username: ${{ secrets.DOCKER_REGISTRY_SERVER_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_SERVER_PASSWORD }}

- name: Build and push container image to registry
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5.1.0
with:
push: true
tags: ${{ secrets.DOCKER_REGISTRY_SERVER_URL }}/${{ secrets.DOCKER_REGISTRY_SERVER_USERNAME }}:workers-production-${{ github.sha }}
Expand All @@ -129,9 +130,9 @@ jobs:
steps:
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
uses: azure/webapps-deploy@v3
with:
app-name: invoicegenerator-func-prod
app-name: invoicegenerator-func-production
slot-name: production
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE_FUNC_PROD }}
images: ${{ secrets.DOCKER_REGISTRY_SERVER_URL }}/${{ secrets.DOCKER_REGISTRY_SERVER_USERNAME }}:workers-production-${{ github.sha }}
31 changes: 16 additions & 15 deletions .github/workflows/stage_build_test_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ jobs:
steps:

- name: Checkout repository
uses: actions/checkout@v2.2.0
uses: actions/checkout@v4

- name: Variable substitution appsettings file for Staging (NET Core)
uses: microsoft/variable-substitution@v1
uses: TomaszKandula/variable-substitution@v1.0.1
with:
files: ${{ github.workspace }}/InvoiceGenerator.WebApi/appsettings.Staging.json
files: ${{ github.workspace }}/InvoiceGenerator.Configuration/appsettings.Staging.json
env:
ConnectionStrings.DbConnect: "${{ secrets.CONNECTIONSTRINGS__DBCONNECT_STAGE }}"
ConnectionStrings.DbConnectTest: "${{ secrets.CONNECTIONSTRINGS__DBCONNECT_TEST }}"
DbConnect: "${{ secrets.DBCONNECT_STAGE }}"
AZ_Storage_ContainerName: "${{ secrets.STORAGE_CONTAINER_NAME_STAGE }}"
AZ_Storage_ConnectionString: "${{ secrets.STORAGE_CONNECTION_STRING }}"

- name: Staging | Build Docker (prepare)
uses: azure/docker-login@v1
uses: azure/docker-login@v1.0.1
with:
login-server: ${{ secrets.DOCKER_REGISTRY_SERVER_URL }}
username: ${{ secrets.DOCKER_REGISTRY_SERVER_USERNAME }}
Expand All @@ -34,7 +35,7 @@ jobs:
run: docker build -f webapi.dockerfile -t ${{ secrets.DOCKER_REGISTRY_SERVER_URL }}/${{ secrets.DOCKER_REGISTRY_SERVER_USERNAME }}:backend-staging-${{ github.sha }} .

- name: Staging | Push Docker image (prepare)
uses: azure/docker-login@v1
uses: azure/docker-login@v1.0.1
with:
login-server: ${{ secrets.DOCKER_REGISTRY_SERVER_URL }}
username: ${{ secrets.DOCKER_REGISTRY_SERVER_USERNAME }}
Expand All @@ -46,9 +47,9 @@ jobs:
# Note: due to a budget constraints, we use separate Azure App Service for staging as the separate slots
# are unavailable for B1, B2 and B3 pricing tiers
- name: Staging | Deploy to Azure Web App
uses: azure/webapps-deploy@v2
uses: azure/webapps-deploy@v3
with:
app-name: invoicegenerator-stage
app-name: invoicegenerator-staging
slot-name: production
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE_BACKEND_STAGE }}
images: ${{ secrets.DOCKER_REGISTRY_SERVER_URL }}/${{ secrets.DOCKER_REGISTRY_SERVER_USERNAME }}:backend-staging-${{ github.sha }}
Expand All @@ -58,20 +59,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Log in to container registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY_SERVER_URL }}
username: ${{ secrets.DOCKER_REGISTRY_SERVER_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_SERVER_PASSWORD }}

- name: Build and push container image to registry
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5.1.0
with:
push: true
tags: ${{ secrets.DOCKER_REGISTRY_SERVER_URL }}/${{ secrets.DOCKER_REGISTRY_SERVER_USERNAME }}:workers-staging-${{ github.sha }}
Expand All @@ -90,9 +91,9 @@ jobs:
steps:
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
uses: azure/webapps-deploy@v3
with:
app-name: invoicegenerator-func-stage
app-name: invoicegenerator-func-staging
slot-name: production
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE_FUNC_STAGE }}
images: ${{ secrets.DOCKER_REGISTRY_SERVER_URL }}/${{ secrets.DOCKER_REGISTRY_SERVER_USERNAME }}:workers-staging-${{ github.sha }}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
namespace InvoiceGenerator.Backend.Core.Converters;

using System;
using System;
using System.Collections.Concurrent;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Collections.Concurrent;
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json;

namespace InvoiceGenerator.Backend.Core.Converters;

/// <summary>
/// Dynamic String to Enum converter for unknown types. Converter sets Unknown member for unsupported types.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace InvoiceGenerator.Backend.Core.Exceptions;

using System;
using System.Runtime.Serialization;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;

namespace InvoiceGenerator.Backend.Core.Exceptions;

[ExcludeFromCodeCoverage]
[Serializable]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace InvoiceGenerator.Backend.Core.Exceptions;

using Microsoft.AspNetCore.Mvc;
using System.Diagnostics.CodeAnalysis;
using InvoiceGenerator.Backend.Core.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Versioning;
using System.Diagnostics.CodeAnalysis;
using Models;

namespace InvoiceGenerator.Backend.Core.Exceptions;

[ExcludeFromCodeCoverage]
public class ApiVersionException : IErrorResponseProvider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace InvoiceGenerator.Backend.Core.Exceptions;

using System;
using System.Runtime.Serialization;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;

namespace InvoiceGenerator.Backend.Core.Exceptions;

[ExcludeFromCodeCoverage]
[Serializable]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace InvoiceGenerator.Backend.Core.Exceptions;

using System;
using System.Runtime.Serialization;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;

namespace InvoiceGenerator.Backend.Core.Exceptions;

[ExcludeFromCodeCoverage]
[Serializable]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace InvoiceGenerator.Backend.Core.Exceptions;

using System;
using System.Runtime.Serialization;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;

namespace InvoiceGenerator.Backend.Core.Exceptions;

[ExcludeFromCodeCoverage]
[Serializable]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace InvoiceGenerator.Backend.Core.Exceptions;

using System;
using System.Runtime.Serialization;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;
using FluentValidation.Results;

namespace InvoiceGenerator.Backend.Core.Exceptions;

[ExcludeFromCodeCoverage]
[Serializable]
public class ValidationException : BusinessException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace InvoiceGenerator.Backend.Core.Extensions;

using System;
using System.Diagnostics.CodeAnalysis;
using FluentValidation;
using Models;
using InvoiceGenerator.Backend.Core.Models;

namespace InvoiceGenerator.Backend.Core.Extensions;

[ExcludeFromCodeCoverage]
public static class DateValidationExtensions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace InvoiceGenerator.Backend.Core.Extensions;

using System;
using System.Linq;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Linq;

namespace InvoiceGenerator.Backend.Core.Extensions;

[ExcludeFromCodeCoverage]
public static class EnumExtensions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace InvoiceGenerator.Backend.Core.Extensions;

using System;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;

namespace InvoiceGenerator.Backend.Core.Extensions;

[ExcludeFromCodeCoverage]
public static class EnumerableExtensions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace InvoiceGenerator.Backend.Core.Extensions;

using System;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Linq.Expressions;
using System.Diagnostics.CodeAnalysis;

namespace InvoiceGenerator.Backend.Core.Extensions;

[ExcludeFromCodeCoverage]
public static class QueryableExtensions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace InvoiceGenerator.Backend.Core.Extensions;

using System;
using System.Text;
using System.Globalization;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Text;

namespace InvoiceGenerator.Backend.Core.Extensions;

[ExcludeFromCodeCoverage]
public static class StringExtensions
Expand Down
Loading

0 comments on commit 37ca8fd

Please sign in to comment.