Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: ensure unique revisions for deployments #1211

Merged
merged 5 commits into from
Oct 2, 2024
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
6 changes: 5 additions & 1 deletion .azure/applications/graphql/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ param location string
@minLength(3)
param apimIp string

@description('The suffix for the revision of the container app')
@minLength(3)
param revisionSuffix string

@description('CPU and memory resources for the container app')
param resources object?

Expand Down Expand Up @@ -87,7 +91,7 @@ module containerApp '../../modules/containerApp/main.bicep' = {
apimIp: apimIp
tags: tags
resources: resources
revisionSuffix: imageTag
revisionSuffix: revisionSuffix
}
}

Expand Down
1 change: 1 addition & 0 deletions .azure/applications/graphql/prod.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ param environment = 'prod'
param location = 'norwayeast'
param apimIp = '51.120.88.54'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
Expand Down
1 change: 1 addition & 0 deletions .azure/applications/graphql/staging.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ param environment = 'staging'
param location = 'norwayeast'
param apimIp = '51.13.86.131'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
Expand Down
1 change: 1 addition & 0 deletions .azure/applications/graphql/test.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ param environment = 'test'
param location = 'norwayeast'
param apimIp = '51.120.88.69'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
Expand Down
6 changes: 5 additions & 1 deletion .azure/applications/web-api-eu/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ param location string
@minLength(3)
param apimIp string

@description('The suffix for the revision of the container app')
@minLength(3)
param revisionSuffix string

@description('CPU and memory resources for the container app')
param resources object?

Expand Down Expand Up @@ -90,7 +94,7 @@ module containerApp '../../modules/containerApp/main.bicep' = {
apimIp: apimIp
tags: tags
resources: resources
revisionSuffix: imageTag
revisionSuffix: revisionSuffix
arealmaas marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
1 change: 1 addition & 0 deletions .azure/applications/web-api-eu/prod.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ param environment = 'prod'
param location = 'norwayeast'
param apimIp = '51.120.88.54'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
Expand Down
1 change: 1 addition & 0 deletions .azure/applications/web-api-eu/staging.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ param environment = 'staging'
param location = 'norwayeast'
param apimIp = '51.13.86.131'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
Expand Down
1 change: 1 addition & 0 deletions .azure/applications/web-api-eu/test.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ param environment = 'test'
param location = 'norwayeast'
param apimIp = '51.120.88.69'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
Expand Down
6 changes: 5 additions & 1 deletion .azure/applications/web-api-so/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ param location string
@minLength(3)
param apimIp string

@description('The suffix for the revision of the container app')
@minLength(3)
param revisionSuffix string

@description('CPU and memory resources for the container app')
param resources object?

Expand Down Expand Up @@ -94,7 +98,7 @@ module containerApp '../../modules/containerApp/main.bicep' = {
apimIp: apimIp
tags: tags
resources: resources
revisionSuffix: imageTag
revisionSuffix: revisionSuffix
}
}

Expand Down
1 change: 1 addition & 0 deletions .azure/applications/web-api-so/prod.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ param environment = 'prod'
param location = 'norwayeast'
param apimIp = '51.120.88.54'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
Expand Down
1 change: 1 addition & 0 deletions .azure/applications/web-api-so/staging.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ param environment = 'staging'
param location = 'norwayeast'
param apimIp = '51.13.86.131'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')
arealmaas marked this conversation as resolved.
Show resolved Hide resolved

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
Expand Down
1 change: 1 addition & 0 deletions .azure/applications/web-api-so/test.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ param environment = 'test'
param location = 'norwayeast'
param apimIp = '51.120.88.69'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/action-deploy-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ jobs:
permissions:
id-token: write
contents: read
env:
REVISION_SUFFIX: "${{ github.run_id }}-${{ inputs.version }}-${{ github.run_attempt}}"
steps:
- name: "Checkout GitHub Action"
uses: actions/checkout@v4
Expand All @@ -159,14 +161,14 @@ jobs:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Dryrun Deploy app ${{ matrix.name }}(${{ inputs.environment }})
uses: azure/arm-deploy@v2
if: ${{ inputs.dryRun }}
id: deploy-dry-run
env:
# parameters
IMAGE_TAG: ${{ inputs.version }}
REVISION_SUFFIX: ${{ env.REVISION_SUFFIX }}
arealmaas marked this conversation as resolved.
Show resolved Hide resolved
# secrets
AZURE_CONTAINER_APP_ENVIRONMENT_NAME: ${{ secrets.AZURE_CONTAINER_APP_ENVIRONMENT_NAME }}
AZURE_APP_INSIGHTS_CONNECTION_STRING: ${{ secrets.AZURE_APP_INSIGHTS_CONNECTION_STRING }}
Expand All @@ -190,6 +192,7 @@ jobs:
env:
# parameters
IMAGE_TAG: ${{ inputs.version }}
REVISION_SUFFIX: ${{ env.REVISION_SUFFIX }}
# secrets
AZURE_CONTAINER_APP_ENVIRONMENT_NAME: ${{ secrets.AZURE_CONTAINER_APP_ENVIRONMENT_NAME }}
AZURE_APP_INSIGHTS_CONNECTION_STRING: ${{ secrets.AZURE_APP_INSIGHTS_CONNECTION_STRING }}
Expand Down
Loading