Merge pull request #213 from Soruk/yamlfixes

Fixes Yaml Powershell tasks for bicep deployment with variables with '$'
pull/217/head
Marcus Felling 2023-02-14 13:59:35 -06:00 committed by GitHub
commit 6724df017a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 6 deletions

View File

@ -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
@ -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

View File

@ -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:

View File

@ -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