-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathdeploy-local.ps1
More file actions
63 lines (53 loc) · 2.35 KB
/
deploy-local.ps1
File metadata and controls
63 lines (53 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
[CmdletBinding()]
param()
$verbose = $PSBoundParameters.Verbose.IsPresent
Write-Host "Verbose: $verbose"
# Getting the variables from the parameters.json file
./scripts/bicep-get-variables.ps1 -fileName "parameters.json"
# Checking if this is the first deployment
$isFirstDeployment = ./scripts/bicep-first-deployment-check.ps1 -managementGroupId $env:MANAGEMENT_GROUP_ID
%{ for on_demand_folder in on_demand_folders ~}
# Downloading the on demand folder for ${on_demand_folder.target}
./scripts/bicep-on-demand-folder.ps1 `
-repository "${on_demand_folder_repository}" `
-releaseArtifactName "${on_demand_folder_artifact_name}" `
-releaseVersion $env:RELEASE_VERSION `
-sourcePath "${on_demand_folder.source}" `
-targetPath "${on_demand_folder.target}" `
%{ endfor ~}
%{ for script_file in script_files ~}
# Running What If for ${script_file.displayName}
./scripts/bicep-deploy.ps1 `
-displayName "${script_file.displayName}" `
-templateFilePath "${script_file.templateFilePath}" `
-templateParametersFilePath "${script_file.templateParametersFilePath}" `
-managementGroupId ${script_file.managementGroupIdVariable} `
-subscriptionId ${script_file.subscriptionIdVariable} `
-resourceGroupName ${script_file.resourceGroupNameVariable} `
-location $env:LOCATION `
-deploymentType "${script_file.deploymentType}" `
-firstRunWhatIf ${script_file.firstRunWhatIf} `
-firstDeployment $isFirstDeployment `
-whatIf
%{ endfor ~}
Write-Host ""
$deployApproved = Read-Host -Prompt "Type 'yes' and hit Enter to continue with the full deployment"
Write-Host ""
if($deployApproved -ne "yes") {
Write-Error "Deployment was not approved. Exiting..."
exit 1
}
%{ for script_file in script_files ~}
# Running Deployment for ${script_file.displayName}
./scripts/bicep-deploy.ps1 `
-displayName "${script_file.displayName}" `
-templateFilePath "${script_file.templateFilePath}" `
-templateParametersFilePath "${script_file.templateParametersFilePath}" `
-managementGroupId ${script_file.managementGroupIdVariable} `
-subscriptionId ${script_file.subscriptionIdVariable} `
-resourceGroupName ${script_file.resourceGroupNameVariable} `
-location $env:LOCATION `
-deploymentType "${script_file.deploymentType}" `
-firstRunWhatIf ${script_file.firstRunWhatIf} `
-firstDeployment $isFirstDeployment `
%{ endfor ~}