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

Commit

Permalink
Merge pull request #213 from Soruk/yamlfixes
Browse files Browse the repository at this point in the history
Fixes Yaml Powershell tasks for bicep deployment with variables with '$'
  • Loading branch information
MarcusFelling authored Feb 14, 2023
2 parents 855e108 + e4e261a commit 6724df0
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 6 deletions.
28 changes: 24 additions & 4 deletions .github/workflows/template-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ jobs:
with:
azPSVersion: "3.1.0"
inlineScript: |
az deployment group create -n ghactionbgtasks${{ github.sha }} -g ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} --template-file deploy/Services/acr.bicep --parameters acrName=${{secrets.ACR_NAME}}
$deploymentName = 'ghactionbgtasks${{ github.sha }}'
$resourceGroupName = '${{ secrets.AZURE_RESOURCE_GROUP_NAME }}'
$acrName = '${{ secrets.ACR_NAME }}'
az deployment group create -n "$($deploymentName)" `
--resource-group "$($resourceGroupName)" `
--template-file deploy/Services/acr.bicep `
--parameters acrName="$($acrName)"
- name: Login to ACR
uses: docker/login-action@v1
Expand Down Expand Up @@ -51,10 +58,23 @@ jobs:
azPSVersion: "3.1.0"
failOnStandardError: true
inlineScript: |
az deployment group create -n ghaction${{ github.sha }} `
--resource-group ${{secrets.AZURE_RESOURCE_GROUP_NAME}} `
$deploymentName = 'ghaction${{ github.sha }}'
$resourceGroupName = '${{ secrets.AZURE_RESOURCE_GROUP_NAME }}'
$acrName = '${{ secrets.ACR_NAME }}'
$imageTag = '${{ github.sha }}'
$administratorLogin = '${{ secrets.PODCASTDB_USER_LOGIN }}'
$administratorLoginPassword = '${{ secrets.PODCASTDB_USER_PASSWORD }}'
$storageAccountName = '${{ secrets.STORAGE_NAME }}'
$serverName= '${{ secrets.PODCASTDB_SERVER_NAME }}'
$kubernetesEnvName = '${{ secrets.KUBERNETES_ENV_NAME }}'
$workspaceName = '${{ secrets.WORKSPACE_NAME }}'
$apiName = '${{ secrets.API_RESOURCE_NAME }}'
$updaterName = '${{ secrets.UPDATER_RESOURCE_NAME }}'
az deployment group create -n "$($deploymentName)" `
--resource-group "$($resourceGroupName)" `
--template-file deploy/Services/api.bicep `
--parameters acrName=${{ secrets.ACR_NAME }} imageTag=${{ github.sha }} administratorLogin=${{secrets.PODCASTDB_USER_LOGIN}} administratorLoginPassword=${{secrets.PODCASTDB_USER_PASSWORD}} storageAccountName=${{ secrets.STORAGE_NAME }} serverName=${{secrets.PODCASTDB_SERVER_NAME}} kubernetesEnvName=${{secrets.KUBERNETES_ENV_NAME}} workspaceName=${{secrets.WORKSPACE_NAME}} apiName=${{secrets.API_RESOURCE_NAME}} updaterName=${{secrets.UPDATER_RESOURCE_NAME}}
--parameters acrName="$($acrName)" imageTag="$($imageTag)" administratorLogin="$($administratorLogin)" administratorLoginPassword="$($administratorLoginPassword)" storageAccountName="$($storageAccountName)" serverName="$($serverName)" kubernetesEnvName="$($kubernetesEnvName)" workspaceName="$($workspaceName)" apiName="$($apiName)" updaterName="$($updaterName)"
if( $LASTEXITCODE -ne 0 ) { exit -1 }
- name: Upload Images
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/template-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,20 @@ jobs:
with:
azPSVersion: "3.1.0"
inlineScript: |
az deployment group create -n ghactionlistentogether${{ github.sha }} -g ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} --template-file deploy/Services/hub.bicep --parameters webAppName=${{secrets.HUB_WEBAPP_NAME}} servicePlanName=${{secrets.SERVICE_PLAN_NAME}} storageAccountName=${{secrets.STORAGE_NAME}} administratorLogin=${{secrets.PODCASTDB_USER_LOGIN}} administratorLoginPassword=${{secrets.PODCASTDB_USER_PASSWORD}} serverName=${{secrets.PODCASTDB_SERVER_NAME}} apiName=${{secrets.API_RESOURCE_NAME}}
$deploymentName = 'ghactionlistentogether${{ github.sha }}'
$resourceGroupName = '${{ secrets.AZURE_RESOURCE_GROUP_NAME }}'
$webAppName = '${{ secrets.HUB_WEBAPP_NAME }}'
$servicePlanName = '${{ secrets.SERVICE_PLAN_NAME }}'
$storageAccountName = '${{ secrets.STORAGE_NAME }}'
$administratorLogin = '${{ secrets.PODCASTDB_USER_LOGIN }}'
$administratorLoginPassword = '${{ secrets.PODCASTDB_USER_PASSWORD }}'
$serverName = '${{ secrets.PODCASTDB_SERVER_NAME }}'
$apiName = '${{ secrets.API_RESOURCE_NAME }}'
az deployment group create -n "$($deploymentName)" `
--resource-group "$($resourceGroupName)" `
--template-file deploy/Services/hub.bicep `
--parameters webAppName="$($webAppName)" servicePlanName="$($servicePlanName)" storageAccountName="$($storageAccountName)" administratorLogin="$($administratorLogin)" administratorLoginPassword="$($administratorLoginPassword)" serverName="$($serverName)" apiName="$($apiName)"
- uses: actions/download-artifact@v3
with:
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/template-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,18 @@ jobs:
with:
azPSVersion: "3.1.0"
inlineScript: |
az deployment group create -n ghaction -g ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} --template-file deploy/Web/web.bicep --parameters webAppName=${{ secrets.WEBAPP_NAME }} servicePlanName=${{ secrets.SERVICE_PLAN_NAME }} servicePlanSku=${{ secrets.SERVICE_PLAN_SKU }} hubWebAppName=${{ secrets.HUB_WEBAPP_NAME }} apiName=${{secrets.API_RESOURCE_NAME}} updaterName=${{secrets.UPDATER_RESOURCE_NAME}}
$deploymentName = 'ghaction${{ github.sha }}'
$resourceGroupName = '${{ secrets.AZURE_RESOURCE_GROUP_NAME }}'
$webAppName = '${{ secrets.WEBAPP_NAME }}'
$servicePlanName = '${{ secrets.SERVICE_PLAN_NAME }}'
$servicePlanSku = '${{ secrets.SERVICE_PLAN_SKU }}'
$hubWebAppName = '${{ secrets.HUB_WEBAPP_NAME }}'
$apiName = '${{ secrets.API_RESOURCE_NAME }}'
az deployment group create -n "$($deploymentName)" `
--resource-group "$($resourceGroupName)" `
--template-file deploy/Web/web.bicep `
--parameters webAppName="$($webAppName)" servicePlanName="$($servicePlanName)" servicePlanSku="$($servicePlanSku)" hubWebAppName="$($hubWebAppName)" apiName="$($apiName)"
- name: Download web artifacts
uses: actions/download-artifact@v3
Expand Down

0 comments on commit 6724df0

Please sign in to comment.