Skip to content

Commit

Permalink
Merge pull request #19 from AlexanderSehr/users/alsehr/carml08
Browse files Browse the repository at this point in the history
Updated to CARML 0.8.0, updated Windows support & parameter interface
  • Loading branch information
AlexanderSehr authored Dec 3, 2022
2 parents 28334dc + 94d9836 commit 6f86633
Show file tree
Hide file tree
Showing 201 changed files with 8,181 additions and 3,137 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,25 @@ jobs:
# Get scale set properties
$templateFilePath = Join-Path '$(parametersPath)' '${{ parameters.environment }}.scaleset.bicep'
$templateContent = az bicep build --file $templateFilePath --stdout --no-restore | ConvertFrom-Json -AsHashtable # No-restore is a workaround for a current issue with the ubuntu-agents (https://github.com/Azure/ResourceModules/issues/1477)
$templateContent = az bicep build --file $templateFilePath --stdout | ConvertFrom-Json -AsHashtable
# Get VMSS name
if($templateContent.resources[-1].properties.parameters.Keys -contains 'virtualMachineScaleSetName') {
# Used explicit value
$VMSSName = $templateContent.resources[-1].properties.parameters['virtualMachineScaleSetName'].value
} else {
# Used default value
$VMSSName = $templateContent.resources[-1].properties.template.parameters['virtualMachineScaleSetName'].defaultValue
}
# Get VMMS RG name
if($templateContent.resources[-1].properties.parameters.Keys -contains 'resourceGroupName') {
# Used explicit value
$VMSSResourceGroupName = $templateContent.resources[-1].properties.parameters['resourceGroupName'].value
} else {
# Used default value
$VMSSResourceGroupName = $templateContent.resources[-1].properties.template.parameters['resourceGroupName'].defaultValue
}
# Get agent pool properties
$agentsParameterFilePath = Join-Path '$(parametersPath)' '${{ parameters.environment }}.agentpool.config.json'
Expand All @@ -127,8 +145,8 @@ jobs:
Organization = $agentPoolParameterFileContent.Organization
Project = $agentPoolParameterFileContent.Project
ServiceConnectionName = $agentPoolParameterFileContent.ServiceConnectionName
VMSSName = $templateContent.variables.vmssParam.name
VMSSResourceGroupName = $templateContent.variables.rgParam.name
VMSSName = $VMSSName
VMSSResourceGroupName = $VMSSResourceGroupName
AgentPoolProperties = $agentPoolParameterFileContent.AgentPoolProperties
}
Expand Down
6 changes: 3 additions & 3 deletions .azuredevops/azureDevOpsScaleSet/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ variables:
poolName_dev: '' # Use this for self-hosted agents
poolName_prd: '' # Use this for self-hosted agents

serviceConnection_sbx: 'sbxConnection'
serviceConnection_dev: 'devConnection'
serviceConnection_prd: 'prdConnection'
serviceConnection_sbx: 'ModulePlaygroundPrivate'
serviceConnection_dev: 'ModulePlaygroundPrivate'
serviceConnection_prd: 'ModulePlaygroundPrivate'
#endregion

#region specific
Expand Down
73 changes: 64 additions & 9 deletions .azuredevops/azureImageBuilder/.templates/pipeline.image.jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,29 @@ jobs:
. (Join-Path '$(System.DefaultWorkingDirectory)' '$(orchestrationFunctionsPath)' 'image' 'Remove-ImageTemplate.ps1')
$templateFilePath = Join-Path '$(parametersPath)' '${{ parameters.environment }}.imageTemplate.bicep'
$templateContent = az bicep build --file $templateFilePath --stdout --no-restore | ConvertFrom-Json -AsHashtable # No-restore is a workaround for a current issue with the ubuntu-agents (https://github.com/Azure/ResourceModules/issues/1477)
$templateContent = az bicep build --file $templateFilePath --stdout | ConvertFrom-Json -AsHashtable
# Get Image Template name
if($templateContent.resources[-1].properties.parameters.Keys -contains 'imageTemplateName') {
# Used explicit value
$imageTemplateName = $templateContent.resources[-1].properties.parameters['imageTemplateName'].value
} else {
# Used default value
$imageTemplateName = $templateContent.resources[-1].properties.template.parameters['imageTemplateName'].defaultValue
}
# Get Resource Group name
if($templateContent.resources[-1].properties.parameters.Keys -contains 'resourceGroupName') {
# Used explicit value
$resourceGroupName = $templateContent.resources[-1].properties.parameters['resourceGroupName'].value
} else {
# Used default value
$resourceGroupName = $templateContent.resources[-1].properties.template.parameters['resourceGroupName'].defaultValue
}
$functionInput = @{
resourcegroupName = $templateContent.variables.rgParam.name
resourcegroupName = $resourceGroupName
# imageTemplateName = $templateContent.variables.itParam.name
# Workaround until 'https://github.com/Azure/bicep/issues/6955' is resolved. Then the above snippet can be used
Expand Down Expand Up @@ -100,11 +119,29 @@ jobs:
. (Join-Path '$(System.DefaultWorkingDirectory)' '$(orchestrationFunctionsPath)' 'image' 'Remove-DeploymentScript.ps1')
$templateFilePath = Join-Path '$(parametersPath)' '${{ parameters.environment }}.imageTemplate.bicep'
$templateContent = az bicep build --file $templateFilePath --stdout --no-restore | ConvertFrom-Json -AsHashtable # No-restore is a workaround for a current issue with the ubuntu-agents (https://github.com/Azure/ResourceModules/issues/1477)
$templateContent = az bicep build --file $templateFilePath --stdout | ConvertFrom-Json -AsHashtable
# Get Deployment Script prefix name
if($templateContent.resources[-1].properties.parameters.Keys -contains 'deploymentScriptName') {
# Used explicit value
$deploymentScriptName = $templateContent.resources[-1].properties.parameters['deploymentScriptName'].value
} else {
# Used default value
$deploymentScriptName = $templateContent.resources[-1].properties.template.parameters['deploymentScriptName'].defaultValue
}
# Get Resource Group name
if($templateContent.resources[-1].properties.parameters.Keys -contains 'resourceGroupName') {
# Used explicit value
$resourceGroupName = $templateContent.resources[-1].properties.parameters['resourceGroupName'].value
} else {
# Used default value
$resourceGroupName = $templateContent.resources[-1].properties.template.parameters['resourceGroupName'].defaultValue
}
$functionInput = @{
resourcegroupName = $templateContent.variables.rgParam.name
deploymentScriptPrefix = $templateContent.variables.dsParam.defaultPrefix
resourcegroupName = $resourceGroupName
deploymentScriptPrefix = $deploymentScriptName
}
Write-Verbose "Invoke task with" -Verbose
Expand Down Expand Up @@ -222,10 +259,19 @@ jobs:
. (Join-Path '$(System.DefaultWorkingDirectory)' '$(orchestrationFunctionsPath)' 'storage' 'Invoke-StorageAccountPostDeployment.ps1')
$templateFilePath = Join-Path '$(parametersPath)' '${{ parameters.environment }}.imageInfra.bicep'
$templateContent = az bicep build --file $templateFilePath --stdout --no-restore | ConvertFrom-Json -AsHashtable # No-restore is a workaround for a current issue with the ubuntu-agents (https://github.com/Azure/ResourceModules/issues/1477)
$templateContent = az bicep build --file $templateFilePath --stdout | ConvertFrom-Json -AsHashtable
# Get Storage Account name
if($templateContent.resources[-1].properties.parameters.Keys -contains 'storageAccountName') {
# Used explicit value
$storageAccountName = $templateContent.resources[-1].properties.parameters['storageAccountName'].value
} else {
# Used default value
$storageAccountName = $templateContent.resources[-1].properties.template.parameters['storageAccountName'].defaultValue
}
$functionInput = @{
storageAccountName = $templateContent.variables.saParam.name
StorageAccountName = $storageAccountName
}
Write-Verbose "Invoke task with" -Verbose
Expand Down Expand Up @@ -310,10 +356,19 @@ jobs:
. '$(Build.Repository.LocalPath)/$(orchestrationFunctionsPath)/image/Wait-ForImageBuild.ps1'
$templateFilePath = Join-Path '$(parametersPath)' '${{ parameters.environment }}.imageTemplate.bicep'
$templateContent = az bicep build --file $templateFilePath --stdout --no-restore | ConvertFrom-Json -AsHashtable # No-restore is a workaround for a current issue with the ubuntu-agents (https://github.com/Azure/ResourceModules/issues/1477)
$templateContent = az bicep build --file $templateFilePath --stdout | ConvertFrom-Json -AsHashtable
# Get Resource Group name
if($templateContent.resources[-1].properties.parameters.Keys -contains 'resourceGroupName') {
# Used explicit value
$resourceGroupName = $templateContent.resources[-1].properties.parameters['resourceGroupName'].value
} else {
# Used default value
$resourceGroupName = $templateContent.resources[-1].properties.template.parameters['resourceGroupName'].defaultValue
}
$functionInput = @{
ResourceGroupName = $templateContent.variables.rgParam.name
ResourceGroupName = $resourceGroupName
ImageTemplateName = $env:IMAGETEMPATENAME # template deployment output
}
Expand Down
6 changes: 3 additions & 3 deletions .azuredevops/azureImageBuilder/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ variables:
poolName_dev: '' # Use this for self-hosted agents
poolName_prd: '' # Use this for self-hosted agents

serviceConnection_sbx: 'sbxConnection'
serviceConnection_dev: 'devConnection'
serviceConnection_prd: 'prdConnection'
serviceConnection_sbx: 'ModulePlaygroundPrivate'
serviceConnection_dev: 'ModulePlaygroundPrivate'
serviceConnection_prd: 'ModulePlaygroundPrivate'
#endregion

#region specific
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6f86633

Please sign in to comment.