Skip to content
Draft
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
49 changes: 44 additions & 5 deletions .github/workflows/linearb-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,46 @@ on:
default: ''

jobs:
get_azure_config:
runs-on: [idp]
permissions:
id-token: write
outputs:
client_id: ${{ steps.get_azure_config.outputs.client_id }}
tenant_id: ${{ steps.get_azure_config.outputs.tenant_id }}
steps:
- id: get_azure_config
env:
INFRA_CONFIG: ${{ vars.INFRA_CONFIG }}
AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
shell: pwsh
run: |
if ($env:AZURE_CLIENT_ID) {
$ClientId = $env:AZURE_CLIENT_ID
} elseif ($env:INFRA_CONFIG) {
$ClientId = (ConvertFrom-Json $env:INFRA_CONFIG).repo_identity_client_id
} else {
Write-Error "Neither AZURE_CLIENT_ID nor INFRA_CONFIG is set. Cannot determine client id."
exit 1
}
echo "client_id=$ClientId"
"client_id=$ClientId" >> $env:GITHUB_OUTPUT

if ($env:AZURE_TENANT_ID) {
$TenantId = $env:AZURE_TENANT_ID
} elseif ($env:INFRA_CONFIG) {
$TenantId = (ConvertFrom-Json $env:INFRA_CONFIG).tenant_id
} else {
Write-Error "Neither AZURE_TENANT_ID nor INFRA_CONFIG is set. Cannot determine tenant id."
exit 1
}
echo "tenant_id=$TenantId"
"tenant_id=$TenantId" >> $env:GITHUB_OUTPUT

linearb_deployment:
runs-on: [idp]
needs: get_azure_config
environment: ${{ inputs.github_environment }}
permissions:
id-token: write
Expand All @@ -26,8 +64,8 @@ jobs:
id: get_linearb_secret
uses: workleap/wl-reusable-workflows/retrieve-managed-secret@main
with:
azure-client-id: ${{ vars.AZURE_CLIENT_ID }}
azure-tenant-id: ${{ vars.AZURE_TENANT_ID }}
azure-client-id: ${{ needs.get_azure_config.outputs.client_id }}
azure-tenant-id: ${{ needs.get_azure_config.outputs.tenant_id }}
azure-subscription-id: ${{ vars.WORKLEAP_GLOBAL_KEYVAULT_SUBSCRIPTION_ID }}
keyvault-name: ${{ vars.WORKLEAP_GLOBAL_KEYVAULT_NAME }}
secret-name: "LinearBApiKey"
Expand Down Expand Up @@ -57,8 +95,9 @@ jobs:
Write-Host "response ##################################################"
Write-Host $response

cortex-deployment:
cortex_deployment:
runs-on: [idp]
needs: get_azure_config
if: ${{ inputs.cortexEntityIdOrTag != '' }}
environment: ${{ inputs.github_environment }}
permissions:
Expand All @@ -68,8 +107,8 @@ jobs:
id: get_cortex_secret
uses: workleap/wl-reusable-workflows/retrieve-managed-secret@main
with:
azure-client-id: ${{ vars.AZURE_CLIENT_ID }}
azure-tenant-id: ${{ vars.AZURE_TENANT_ID }}
azure-client-id: ${{ needs.get_azure_config.outputs.client_id }}
azure-tenant-id: ${{ needs.get_azure_config.outputs.tenant_id }}
azure-subscription-id: ${{ vars.WORKLEAP_GLOBAL_KEYVAULT_SUBSCRIPTION_ID }}
keyvault-name: ${{ vars.WORKLEAP_GLOBAL_KEYVAULT_NAME }}
secret-name: "CortexApiKey"
Expand Down