Skip to content

Commit

Permalink
Squash
Browse files Browse the repository at this point in the history
  • Loading branch information
Fargekritt committed Nov 25, 2024
1 parent c51d2f5 commit d33461f
Show file tree
Hide file tree
Showing 24 changed files with 12,721 additions and 91 deletions.
182 changes: 91 additions & 91 deletions .github/workflows/ci-cd-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,94 +6,94 @@ on:
paths-ignore:
- "tests/k6/**"
- "CHANGELOG.md"

jobs:
generate-git-short-sha:
name: Generate git short sha
uses: ./.github/workflows/workflow-generate-git-short-sha.yml

get-current-version:
name: Get current version
uses: ./.github/workflows/workflow-get-current-version.yml

check-for-changes:
name: Check for changes
uses: ./.github/workflows/workflow-check-for-changes.yml

build:
uses: ./.github/workflows/workflow-build-and-test.yml
needs: [check-for-changes]
if: ${{ needs.check-for-changes.outputs.hasBackendChanges == 'true' || needs.check-for-changes.outputs.hasTestChanges == 'true' }}

build-infrastructure:
uses: ./.github/workflows/workflow-build-infrastructure.yml
needs: [check-for-changes]
if: ${{ always() && needs.check-for-changes.outputs.hasInfraChanges == 'true' }}
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
with:
environment: "test"

dry-run-deploy-infra:
name: Dry run deploy infrastructure
uses: ./.github/workflows/workflow-deploy-infra.yml
needs:
[
generate-git-short-sha,
check-for-changes,
get-current-version,
build-infrastructure,
]
if: ${{ always() && needs.check-for-changes.outputs.hasInfraChanges == 'true' }}
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_SOURCE_KEY_VAULT_NAME: ${{ secrets.AZURE_SOURCE_KEY_VAULT_NAME }}
AZURE_SOURCE_KEY_VAULT_SUBSCRIPTION_ID: ${{ secrets.AZURE_SOURCE_KEY_VAULT_SUBSCRIPTION_ID }}
AZURE_SOURCE_KEY_VAULT_RESOURCE_GROUP: ${{ secrets.AZURE_SOURCE_KEY_VAULT_RESOURCE_GROUP }}
AZURE_SOURCE_KEY_VAULT_SSH_JUMPER_SSH_PUBLIC_KEY: ${{ secrets.AZURE_SOURCE_KEY_VAULT_SSH_JUMPER_SSH_PUBLIC_KEY }}
with:
environment: test
region: norwayeast
dryRun: true
version: ${{ needs.get-current-version.outputs.version }}-${{ needs.generate-git-short-sha.outputs.gitShortSha }}

dry-run-deploy-apps:
name: Dry run deploy apps
needs:
[
get-current-version,
check-for-changes,
generate-git-short-sha,
dry-run-deploy-infra,
]
# we want deployment of apps to be dependent on deployment of infrastructure, but if infrastructure is skipped, we still want to deploy the apps
if: ${{ always() && !failure() && !cancelled() && (needs.check-for-changes.outputs.hasBackendChanges == 'true' || needs.check-for-changes.outputs.hasMigrationChanges == 'true') }}
uses: ./.github/workflows/workflow-deploy-apps.yml
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_RESOURCE_GROUP_NAME: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
AZURE_ENVIRONMENT_KEY_VAULT_NAME: ${{ secrets.AZURE_ENVIRONMENT_KEY_VAULT_NAME }}
AZURE_CONTAINER_APP_ENVIRONMENT_NAME: ${{ secrets.AZURE_CONTAINER_APP_ENVIRONMENT_NAME }}
AZURE_APP_INSIGHTS_CONNECTION_STRING: ${{ secrets.AZURE_APP_INSIGHTS_CONNECTION_STRING }}
AZURE_APP_CONFIGURATION_NAME: ${{ secrets.AZURE_APP_CONFIGURATION_NAME }}
AZURE_SERVICE_BUS_NAMESPACE_NAME: ${{ secrets.AZURE_SERVICE_BUS_NAMESPACE_NAME }}
with:
environment: test
region: norwayeast
version: ${{ needs.get-current-version.outputs.version }}-${{ needs.generate-git-short-sha.outputs.gitShortSha }}
runMigration: ${{ needs.check-for-changes.outputs.hasMigrationChanges == 'true' }}
dryRun: true

delete-github-deployments:
name: Delete GitHub deployments
uses: ./.github/workflows/workflow-delete-deployments.yml
needs: [dry-run-deploy-apps, dry-run-deploy-infra]
if: ${{ always() && !failure() && !cancelled() }}
with:
gitSha: ${{ github.event.pull_request.head.sha }}
#
#jobs:
# generate-git-short-sha:
# name: Generate git short sha
# uses: ./.github/workflows/workflow-generate-git-short-sha.yml
#
# get-current-version:
# name: Get current version
# uses: ./.github/workflows/workflow-get-current-version.yml
#
# check-for-changes:
# name: Check for changes
# uses: ./.github/workflows/workflow-check-for-changes.yml
#
# build:
# uses: ./.github/workflows/workflow-build-and-test.yml
# needs: [check-for-changes]
# if: ${{ needs.check-for-changes.outputs.hasBackendChanges == 'true' || needs.check-for-changes.outputs.hasTestChanges == 'true' }}
#
# build-infrastructure:
# uses: ./.github/workflows/workflow-build-infrastructure.yml
# needs: [check-for-changes]
# if: ${{ always() && needs.check-for-changes.outputs.hasInfraChanges == 'true' }}
# secrets:
# AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
# AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
# AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
# with:
# environment: "test"
#
# dry-run-deploy-infra:
# name: Dry run deploy infrastructure
# uses: ./.github/workflows/workflow-deploy-infra.yml
# needs:
# [
# generate-git-short-sha,
# check-for-changes,
# get-current-version,
# build-infrastructure,
# ]
# if: ${{ always() && needs.check-for-changes.outputs.hasInfraChanges == 'true' }}
# secrets:
# AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
# AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
# AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
# AZURE_SOURCE_KEY_VAULT_NAME: ${{ secrets.AZURE_SOURCE_KEY_VAULT_NAME }}
# AZURE_SOURCE_KEY_VAULT_SUBSCRIPTION_ID: ${{ secrets.AZURE_SOURCE_KEY_VAULT_SUBSCRIPTION_ID }}
# AZURE_SOURCE_KEY_VAULT_RESOURCE_GROUP: ${{ secrets.AZURE_SOURCE_KEY_VAULT_RESOURCE_GROUP }}
# AZURE_SOURCE_KEY_VAULT_SSH_JUMPER_SSH_PUBLIC_KEY: ${{ secrets.AZURE_SOURCE_KEY_VAULT_SSH_JUMPER_SSH_PUBLIC_KEY }}
# with:
# environment: test
# region: norwayeast
# dryRun: true
# version: ${{ needs.get-current-version.outputs.version }}-${{ needs.generate-git-short-sha.outputs.gitShortSha }}
#
# dry-run-deploy-apps:
# name: Dry run deploy apps
# needs:
# [
# get-current-version,
# check-for-changes,
# generate-git-short-sha,
# dry-run-deploy-infra,
# ]
# # we want deployment of apps to be dependent on deployment of infrastructure, but if infrastructure is skipped, we still want to deploy the apps
# if: ${{ always() && !failure() && !cancelled() && (needs.check-for-changes.outputs.hasBackendChanges == 'true' || needs.check-for-changes.outputs.hasMigrationChanges == 'true') }}
# uses: ./.github/workflows/workflow-deploy-apps.yml
# secrets:
# AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
# AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
# AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
# AZURE_RESOURCE_GROUP_NAME: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
# AZURE_ENVIRONMENT_KEY_VAULT_NAME: ${{ secrets.AZURE_ENVIRONMENT_KEY_VAULT_NAME }}
# AZURE_CONTAINER_APP_ENVIRONMENT_NAME: ${{ secrets.AZURE_CONTAINER_APP_ENVIRONMENT_NAME }}
# AZURE_APP_INSIGHTS_CONNECTION_STRING: ${{ secrets.AZURE_APP_INSIGHTS_CONNECTION_STRING }}
# AZURE_APP_CONFIGURATION_NAME: ${{ secrets.AZURE_APP_CONFIGURATION_NAME }}
# AZURE_SERVICE_BUS_NAMESPACE_NAME: ${{ secrets.AZURE_SERVICE_BUS_NAMESPACE_NAME }}
# with:
# environment: test
# region: norwayeast
# version: ${{ needs.get-current-version.outputs.version }}-${{ needs.generate-git-short-sha.outputs.gitShortSha }}
# runMigration: ${{ needs.check-for-changes.outputs.hasMigrationChanges == 'true' }}
# dryRun: true
#
# delete-github-deployments:
# name: Delete GitHub deployments
# uses: ./.github/workflows/workflow-delete-deployments.yml
# needs: [dry-run-deploy-apps, dry-run-deploy-infra]
# if: ${{ always() && !failure() && !cancelled() }}
# with:
# gitSha: ${{ github.event.pull_request.head.sha }}
14 changes: 14 additions & 0 deletions .github/workflows/dispatch-apps-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
on:
workflow_dispatch:
jobs:
package-project:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: set PROJECT variable to point to project
run: |
PROJECT=$(find . -name '*Digdir.Library.Dialogporten.WebApiClient.csproj' -printf "%p" -quit)
echo "PROJECT ${PROJECT}"
echo "PROJECT=${PROJECT}" >> $GITHUB_ENV
14 changes: 14 additions & 0 deletions .refitter
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"openApiPath": "docs/schema/V1/swagger.verified.json",
"namespace": "Digdir.Library.Dialogporten.WebApiClient.Features.V1",
"outputFolder": "src/Digdir.Library.Dialogporten.WebApiClient/Features/V1/",
"operationNameGenerator": "SingleClientFromOperationId",
"multipleInterfaces": "ByTag",
"includeTags": [

],
"useCancellationTokens": true,
"returnIApiResponse": true,
"useDynamicQuerystringParameters": true,
"outputFilename": "RefitterInterface.cs"
}
24 changes: 24 additions & 0 deletions Digdir.Domain.Dialogporten.sln
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digdir.Library.Utils.AspNet
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digdir.Tool.Dialogporten.SlackNotifier.Tests", "tests\Digdir.Tool.Dialogporten.SlackNotifier.Tests\Digdir.Tool.Dialogporten.SlackNotifier.Tests.csproj", "{F7DF2792-9C83-49F7-B7DD-556E8EC577DB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebApiClient", "WebApiClient", "{9B809C3A-B169-4599-A2D3-A25E87C510FC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digdir.Library.Dialogporten.WebApiClient", "src\Digdir.Library.Dialogporten.WebApiClient\Digdir.Library.Dialogporten.WebApiClient.csproj", "{714FBB11-ADC0-44E8-A768-D1A59D641D31}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digdir.Library.Dialogporten.WebApiClient.Sample", "src\Digdir.Library.Dialogporten.WebApiClient.Sample\Digdir.Library.Dialogporten.WebApiClient.Sample.csproj", "{F8CB7159-4346-4436-9C35-BFCFDDE5DC2B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digdir.Library.Dialogporten.WebApiClient.Integration.Tests", "tests\Digdir.Library.Dialogporten.WebApiClient.Integration.Tests\Digdir.Library.Dialogporten.WebApiClient.Integration.Tests.csproj", "{7014AC47-0DF5-48C1-BD72-EE587FF3278B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -165,6 +173,18 @@ Global
{F7DF2792-9C83-49F7-B7DD-556E8EC577DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F7DF2792-9C83-49F7-B7DD-556E8EC577DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F7DF2792-9C83-49F7-B7DD-556E8EC577DB}.Release|Any CPU.Build.0 = Release|Any CPU
{714FBB11-ADC0-44E8-A768-D1A59D641D31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{714FBB11-ADC0-44E8-A768-D1A59D641D31}.Debug|Any CPU.Build.0 = Debug|Any CPU
{714FBB11-ADC0-44E8-A768-D1A59D641D31}.Release|Any CPU.ActiveCfg = Release|Any CPU
{714FBB11-ADC0-44E8-A768-D1A59D641D31}.Release|Any CPU.Build.0 = Release|Any CPU
{F8CB7159-4346-4436-9C35-BFCFDDE5DC2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8CB7159-4346-4436-9C35-BFCFDDE5DC2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8CB7159-4346-4436-9C35-BFCFDDE5DC2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8CB7159-4346-4436-9C35-BFCFDDE5DC2B}.Release|Any CPU.Build.0 = Release|Any CPU
{7014AC47-0DF5-48C1-BD72-EE587FF3278B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7014AC47-0DF5-48C1-BD72-EE587FF3278B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7014AC47-0DF5-48C1-BD72-EE587FF3278B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7014AC47-0DF5-48C1-BD72-EE587FF3278B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -196,6 +216,10 @@ Global
{E389C7C8-9610-40AC-86DC-769B1B7DC78E} = {CADB8189-4AA1-4732-844A-C41DBF3EC8B7}
{6A485C65-3613-4A49-A16F-2789119F6F38} = {096E9B69-6783-4446-A895-0B6D7729A0D9}
{F7DF2792-9C83-49F7-B7DD-556E8EC577DB} = {CADB8189-4AA1-4732-844A-C41DBF3EC8B7}
{9B809C3A-B169-4599-A2D3-A25E87C510FC} = {096E9B69-6783-4446-A895-0B6D7729A0D9}
{714FBB11-ADC0-44E8-A768-D1A59D641D31} = {9B809C3A-B169-4599-A2D3-A25E87C510FC}
{F8CB7159-4346-4436-9C35-BFCFDDE5DC2B} = {9B809C3A-B169-4599-A2D3-A25E87C510FC}
{7014AC47-0DF5-48C1-BD72-EE587FF3278B} = {CADB8189-4AA1-4732-844A-C41DBF3EC8B7}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B2FE67FF-7622-4AFB-AD8E-961B6A39D888}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Digdir.Library.Dialogporten.WebApiClient\Digdir.Library.Dialogporten.WebApiClient.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Loading

0 comments on commit d33461f

Please sign in to comment.