Skip to content

Commit 1a1ccc0

Browse files
authored
feat(infrastructure): create new yt01 app environment (#1291)
<!--- Provide a general summary of your changes in the Title above --> ## Description Dependent on #1290 <!--- Describe your changes in detail --> ## Related Issue(s) - #1258 ## Verification - [ ] **Your** code builds clean without any errors or warnings - [ ] Manual testing done (required) - [ ] Relevant automated test added (if you find this hard, leave it and we'll help out) ## Documentation - [ ] Documentation is updated (either in `docs`-directory, Altinnpedia or a separate linked PR in [altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if applicable) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced new Bicep parameter files for various applications, allowing for dynamic configuration based on environment variables. - Added a `deploy-apps` job to the CI/CD workflow for streamlined application deployment to the yt01 environment. - Updated workflow dispatch options to include `yt01` as a selectable environment. - **Bug Fixes** - Streamlined CI/CD configuration by removing commented-out sections for clarity. - **Documentation** - Enhanced parameter definitions for better clarity in deployment configurations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent d6662ce commit 1a1ccc0

File tree

7 files changed

+129
-69
lines changed

7 files changed

+129
-69
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using './main.bicep'
2+
3+
param environment = 'yt01'
4+
param location = 'norwayeast'
5+
param apimIp = '51.13.85.197'
6+
param imageTag = readEnvironmentVariable('IMAGE_TAG')
7+
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')
8+
9+
// secrets
10+
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
11+
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
12+
param appInsightConnectionString = readEnvironmentVariable('AZURE_APP_INSIGHTS_CONNECTION_STRING')
13+
param appConfigurationName = readEnvironmentVariable('AZURE_APP_CONFIGURATION_NAME')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using './main.bicep'
2+
3+
param environment = 'yt01'
4+
param location = 'norwayeast'
5+
param imageTag = readEnvironmentVariable('IMAGE_TAG')
6+
param jobSchedule = '*/5 * * * *' // Runs every 5 minutes
7+
8+
//secrets
9+
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
10+
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
11+
param appInsightConnectionString = readEnvironmentVariable('AZURE_APP_INSIGHTS_CONNECTION_STRING')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using './main.bicep'
2+
3+
param environment = 'yt01'
4+
param location = 'norwayeast'
5+
param apimIp = '51.13.85.197'
6+
param imageTag = readEnvironmentVariable('IMAGE_TAG')
7+
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')
8+
9+
// secrets
10+
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
11+
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
12+
param appInsightConnectionString = readEnvironmentVariable('AZURE_APP_INSIGHTS_CONNECTION_STRING')
13+
param appConfigurationName = readEnvironmentVariable('AZURE_APP_CONFIGURATION_NAME')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using './main.bicep'
2+
3+
param environment = 'yt01'
4+
param location = 'norwayeast'
5+
param imageTag = readEnvironmentVariable('IMAGE_TAG')
6+
7+
//secrets
8+
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
9+
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using './main.bicep'
2+
3+
param environment = 'yt01'
4+
param location = 'norwayeast'
5+
param apimIp = '51.13.85.197'
6+
param imageTag = readEnvironmentVariable('IMAGE_TAG')
7+
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')
8+
9+
// secrets
10+
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
11+
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
12+
param appInsightConnectionString = readEnvironmentVariable('AZURE_APP_INSIGHTS_CONNECTION_STRING')
13+
param appConfigurationName = readEnvironmentVariable('AZURE_APP_CONFIGURATION_NAME')

.github/workflows/ci-cd-yt01.yml

+69-69
Original file line numberDiff line numberDiff line change
@@ -48,75 +48,75 @@ jobs:
4848
region: norwayeast
4949
version: ${{ needs.get-current-version.outputs.version }}
5050

51-
# todo: enable when we have infrastructure set up for yt01
52-
# deploy-apps-yt01:
53-
# name: Deploy apps to yt01
54-
# needs:
55-
# [get-current-version, check-for-changes, deploy-infra, publish]
56-
# # we want deployment of apps to be dependent on deployment of infrastructure, but if infrastructure is skipped, we still want to deploy the apps
57-
# if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasBackendChanges == 'true') }}
58-
# uses: ./.github/workflows/workflow-deploy-apps.yml
59-
# secrets:
60-
# AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
61-
# AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
62-
# AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
63-
# # todo: consider resolving these in another way since they are created in the infra-step
64-
# AZURE_RESOURCE_GROUP_NAME: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
65-
# AZURE_ENVIRONMENT_KEY_VAULT_NAME: ${{ secrets.AZURE_ENVIRONMENT_KEY_VAULT_NAME }}
66-
# AZURE_CONTAINER_APP_ENVIRONMENT_NAME: ${{ secrets.AZURE_CONTAINER_APP_ENVIRONMENT_NAME }}
67-
# AZURE_APP_INSIGHTS_CONNECTION_STRING: ${{ secrets.AZURE_APP_INSIGHTS_CONNECTION_STRING }}
68-
# AZURE_APP_CONFIGURATION_NAME: ${{ secrets.AZURE_APP_CONFIGURATION_NAME }}
69-
# with:
70-
# environment: yt01
71-
# region: norwayeast
72-
# version: ${{ needs.get-current-version.outputs.version }}
73-
# runMigration: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasMigrationChanges == 'true' }}
51+
deploy-apps:
52+
name: Deploy apps to yt01
53+
needs:
54+
[get-current-version, check-for-changes, deploy-infra, publish]
55+
# we want deployment of apps to be dependent on deployment of infrastructure, but if infrastructure is skipped, we still want to deploy the apps
56+
if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasBackendChanges == 'true') }}
57+
uses: ./.github/workflows/workflow-deploy-apps.yml
58+
secrets:
59+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
60+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
61+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
62+
# todo: consider resolving these in another way since they are created in the infra-step
63+
AZURE_RESOURCE_GROUP_NAME: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
64+
AZURE_ENVIRONMENT_KEY_VAULT_NAME: ${{ secrets.AZURE_ENVIRONMENT_KEY_VAULT_NAME }}
65+
AZURE_CONTAINER_APP_ENVIRONMENT_NAME: ${{ secrets.AZURE_CONTAINER_APP_ENVIRONMENT_NAME }}
66+
AZURE_APP_INSIGHTS_CONNECTION_STRING: ${{ secrets.AZURE_APP_INSIGHTS_CONNECTION_STRING }}
67+
AZURE_APP_CONFIGURATION_NAME: ${{ secrets.AZURE_APP_CONFIGURATION_NAME }}
68+
AZURE_SERVICE_BUS_NAMESPACE_NAME: ${{ secrets.AZURE_SERVICE_BUS_NAMESPACE_NAME }}
69+
with:
70+
environment: yt01
71+
region: norwayeast
72+
version: ${{ needs.get-current-version.outputs.version }}
73+
runMigration: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasMigrationChanges == 'true' }}
7474

75-
# deploy-slack-notifier-yt01:
76-
# name: Deploy slack notifier (yt01)
77-
# needs: [check-for-changes]
78-
# if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasSlackNotifierChanges == 'true' }}
79-
# uses: ./.github/workflows/workflow-deploy-function.yml
80-
# secrets:
81-
# AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
82-
# AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
83-
# AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
84-
# # todo: resolve this automatically, or use tags
85-
# AZURE_FUNCTION_APP_NAME: ${{ secrets.AZURE_SLACK_NOTIFIER_FUNCTION_APP_NAME }}
86-
# with:
87-
# function-app-name: "slack-notifier"
88-
# function-project-path: "./src/Digdir.Tool.Dialogporten.SlackNotifier"
89-
# environment: yt01
75+
deploy-slack-notifier:
76+
name: Deploy slack notifier (yt01)
77+
needs: [check-for-changes]
78+
if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasSlackNotifierChanges == 'true' }}
79+
uses: ./.github/workflows/workflow-deploy-function.yml
80+
secrets:
81+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
82+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
83+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
84+
# todo: resolve this automatically, or use tags
85+
AZURE_FUNCTION_APP_NAME: ${{ secrets.AZURE_SLACK_NOTIFIER_FUNCTION_APP_NAME }}
86+
with:
87+
function-app-name: "slack-notifier"
88+
function-project-path: "./src/Digdir.Tool.Dialogporten.SlackNotifier"
89+
environment: yt01
9090

91-
# run-e2e-tests:
92-
# name: "Run K6 functional end-to-end tests"
93-
# # we want the end-to-end tests to be dependent on deployment of infrastructure and apps, but if infrastructure is skipped, we still want to run the tests
94-
# if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasBackendChanges == 'true') }}
95-
# needs: [deploy-apps-yt01, check-for-changes]
96-
# uses: ./.github/workflows/workflow-run-k6-tests.yml
97-
# secrets:
98-
# TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }}
99-
# TOKEN_GENERATOR_PASSWORD: ${{ secrets.TOKEN_GENERATOR_PASSWORD }}
100-
# with:
101-
# environment: yt01
102-
# apiVersion: v1
103-
# testSuitePath: tests/k6/suites/all-single-pass.js
104-
# permissions:
105-
# checks: write
106-
# pull-requests: write
91+
run-e2e-tests:
92+
name: "Run K6 functional end-to-end tests"
93+
# we want the end-to-end tests to be dependent on deployment of infrastructure and apps, but if infrastructure is skipped, we still want to run the tests
94+
if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasBackendChanges == 'true') }}
95+
needs: [deploy-apps, check-for-changes]
96+
uses: ./.github/workflows/workflow-run-k6-tests.yml
97+
secrets:
98+
TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }}
99+
TOKEN_GENERATOR_PASSWORD: ${{ secrets.TOKEN_GENERATOR_PASSWORD }}
100+
with:
101+
environment: yt01
102+
apiVersion: v1
103+
testSuitePath: tests/k6/suites/all-single-pass.js
104+
permissions:
105+
checks: write
106+
pull-requests: write
107107

108-
# send-slack-message-on-failure:
109-
# name: Send Slack message on failure
110-
# needs: [deploy-infra, deploy-apps-yt01, deploy-slack-notifier-yt01, run-e2e-tests, publish]
111-
# if: ${{ always() && failure() && !cancelled() }}
112-
# uses: ./.github/workflows/workflow-send-ci-cd-status-slack-message.yml
113-
# with:
114-
# environment: yt01
115-
# infra_status: ${{ needs.deploy-infra.result }}
116-
# apps_status: ${{ needs.deploy-apps-yt01.result }}
117-
# slack_notifier_status: ${{ needs.deploy-slack-notifier-yt01.result }}
118-
# e2e_tests_status: ${{ needs.run-e2e-tests.result }}
119-
# publish_status: ${{ needs.publish.result }}
120-
# secrets:
121-
# SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
122-
# SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID_FOR_CI_CD_STATUS }}
108+
send-slack-message-on-failure:
109+
name: Send Slack message on failure
110+
needs: [deploy-infra, deploy-apps, deploy-slack-notifier, run-e2e-tests, publish]
111+
if: ${{ always() && failure() && !cancelled() }}
112+
uses: ./.github/workflows/workflow-send-ci-cd-status-slack-message.yml
113+
with:
114+
environment: yt01
115+
infra_status: ${{ needs.deploy-infra.result }}
116+
apps_status: ${{ needs.deploy-apps.result }}
117+
slack_notifier_status: ${{ needs.deploy-slack-notifier.result }}
118+
e2e_tests_status: ${{ needs.run-e2e-tests.result }}
119+
publish_status: ${{ needs.publish.result }}
120+
secrets:
121+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
122+
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID_FOR_CI_CD_STATUS }}

.github/workflows/dispatch-apps.yml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
type: choice
1111
options:
1212
- test
13+
- yt01
1314
- staging
1415
- prod
1516
version:

0 commit comments

Comments
 (0)