Skip to content

Commit 2867847

Browse files
Nepomucenoguy.pritchard
andauthored
Download jit (#4)
# Pull Request Just oin time download of files ## Description Description of changes: Changing the files to download just in time ## License By submitting this pull request, I confirm that my contribution is made under the terms of the projects associated license. --------- Co-authored-by: guy.pritchard <guy.pritchard@noreply.com>
1 parent 1dc0a07 commit 2867847

24 files changed

+541
-663
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ coverage.xml
1111
.Trashes
1212
ehthumbs.db
1313
Thumbs.db
14-
src/ALZ/Assets/alz-bicep-internal/
14+
src/ALZ/Assets/alz-bicep-internal/
15+
test_output/

src/ALZ.build.ps1

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -432,41 +432,6 @@ Add-BuildTask CreateHelpComplete -After CreateExternalHelp {
432432
Write-Build Green ' ...CreateHelp Complete!'
433433
} #CreateHelpStart
434434

435-
436-
Add-BuildTask DownloadALZReleases -After AssetCopy {
437-
Write-Build White ' Downloading ALZ Bicep Supported releases'
438-
439-
$ALZReleases = Invoke-WebRequest -Uri 'https://api.github.com/repos/Azure/ALZ-Bicep/releases' -ErrorAction Stop | ConvertFrom-Json
440-
$ALZReleases | ForEach-Object {
441-
# Skip if the release is has been downloaded already
442-
$tagName = $_.tag_name
443-
$ALZReleaseZipballFileName = "ALZ-Bicep-$tagName"
444-
# remove v from tag name
445-
$alzDirectory = $tagName -replace '^v', ''
446-
$downloadUrl = "https://github.com/Azure/ALZ-Bicep/archive/refs/tags/$tagName.zip"
447-
$ALZReleaseZipballFilePath = "$script:ArtifactsPath/$ALZReleaseZipballFileName.zip"
448-
if (Test-Path -Path "$script:ArtifactsPath/Assets/alz-bicep-internal/ALZ-Bicep-$alzDirectory") {
449-
Write-Build Gray " Skipping $ALZReleaseZipballFileName because it already exists."
450-
return
451-
}
452-
# skip if the release it is not one of the supported releases
453-
if ($script:ALZBicepSupportedReleases -notcontains $tagName) {
454-
Write-Build Gray " Skipping $ALZReleaseZipballFileName because it is not a supported release."
455-
return
456-
}
457-
Write-Build Gray " Downloading $ALZReleaseZipballFileName..."
458-
Invoke-WebRequest -Uri $downloadUrl -OutFile $ALZReleaseZipballFilePath -ErrorAction Stop
459-
Write-Build Gray ' ...Download complete.'
460-
Write-Build Gray ' Extracting ALZ release...'
461-
Expand-Archive -Path $ALZReleaseZipballFilePath -DestinationPath "$script:ArtifactsPath/Assets/alz-bicep-internal/" -Force
462-
Write-Build Gray ' ...Extraction complete.'
463-
Write-Build Gray ' Removing zip file...'
464-
Remove-Item -Path $ALZReleaseZipballFilePath -Force
465-
Write-Build Gray ' ...Zip file removed.'
466-
}
467-
Write-Build Green ' ...ALZ releases downloaded!'
468-
} #DownloadALZReleases
469-
470435
# Synopsis: Copies module assets to Artifacts folder
471436
Add-BuildTask AssetCopy -Before Build {
472437
Write-Build Gray ' Copying assets to Artifacts...'
Lines changed: 211 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,219 @@
11
{
2-
"orchestration": {
3-
"01.managementGroups": {
4-
"source": "infra-as-code/bicep/modules/managementGroups/managementGroups.bicep"
2+
"version": "v0.13.0",
3+
"module_url": "https://github.com/Azure/ALZ-Bicep",
4+
"config_files": [
5+
{
6+
"source": "infra-as-code/bicep/modules/resourceGroup/parameters/resourceGroup.parameters.all.json",
7+
"detination": "config/resourceGroup.parameters.json"
58
},
6-
"02.policy.definitions": {
7-
"source": "infra-as-code/bicep/modules/policy/definitions/customPolicyDefinitions.bicep"
9+
{
10+
"source": "infra-as-code/bicep/modules/policy/definitions/parameters/customPolicyDefinitions.parameters.all.json",
11+
"destination": "config/customPolicyDefinitions.parameters.json"
12+
}
13+
],
14+
"parameters": {
15+
"Prefix": {
16+
"Type": "UserInput",
17+
"Description": "The prefix that will be added to all resources created by this deployment. (e.g. 'alz')",
18+
"Targets": [
19+
{
20+
"Name": "parTopLevelManagementGroupPrefix",
21+
"Destination": "Parameters"
22+
},
23+
{
24+
"Name": "parCompanyPrefix",
25+
"Destination": "Parameters"
26+
},
27+
{
28+
"Name": "parTargetManagementGroupId",
29+
"Destination": "Parameters"
30+
},
31+
{
32+
"Name": "parAssignableScopeManagementGroupId",
33+
"Destination": "Parameters"
34+
}
35+
],
36+
"Value": "",
37+
"DefaultValue": "alz",
38+
"Valid": "^[a-zA-Z]{3,5}$"
39+
},
40+
"Suffix": {
41+
"Type": "UserInput",
42+
"Description": "The suffix that will be added to all resources created by this deployment. (e.g. 'test')",
43+
"Targets": [
44+
{
45+
"Name": "parTopLevelManagementGroupSuffix",
46+
"Destination": "Parameters"
47+
}
48+
],
49+
"Value": "",
50+
"DefaultValue": "",
51+
"Valid": "^[a-zA-Z]{0,5}$"
52+
},
53+
"Location": {
54+
"Type": "UserInput",
55+
"Description": "Deployment location.",
56+
"Value": "",
57+
"Targets": [
58+
{
59+
"Name": "parLocation",
60+
"Destination": "Parameters"
61+
},
62+
{
63+
"Name": "parAutomationAccountLocation",
64+
"Destination": "Parameters"
65+
},
66+
{
67+
"Name": "parLogAnalyticsWorkspaceLocation",
68+
"Destination": "Parameters"
69+
}
70+
],
71+
"AllowedValues": [
72+
"asia",
73+
"asiapacific",
74+
"australia",
75+
"australiacentral",
76+
"australiacentral2",
77+
"australiaeast",
78+
"australiasoutheast",
79+
"brazil",
80+
"brazilsouth",
81+
"brazilsoutheast",
82+
"canada",
83+
"canadacentral",
84+
"canadaeast",
85+
"centralindia",
86+
"centralus",
87+
"centraluseuap",
88+
"centralusstage",
89+
"eastasia",
90+
"eastasiastage",
91+
"eastus",
92+
"eastus2",
93+
"eastus2euap",
94+
"eastus2stage",
95+
"eastusstg",
96+
"europe",
97+
"france",
98+
"francecentral",
99+
"francesouth",
100+
"germany",
101+
"germanynorth",
102+
"germanywestcentral",
103+
"global",
104+
"india",
105+
"japan",
106+
"japaneast",
107+
"japanwest",
108+
"jioindiacentral",
109+
"jioindiawest",
110+
"korea",
111+
"koreacentral",
112+
"koreasouth",
113+
"northcentralus",
114+
"northcentralusstage",
115+
"northeurope",
116+
"norway",
117+
"norwayeast",
118+
"norwaywest",
119+
"qatarcentral",
120+
"singapore",
121+
"southafrica",
122+
"southafricanorth",
123+
"southafricawest",
124+
"southcentralus",
125+
"southcentralusstage",
126+
"southeastasia",
127+
"southindia",
128+
"swedencentral",
129+
"switzerland",
130+
"switzerlandnorth",
131+
"switzerlandwest",
132+
"uaecentral",
133+
"uaenorth",
134+
"uksouth",
135+
"ukwest",
136+
"unitedstates",
137+
"westcentralus",
138+
"westeurope",
139+
"westindia",
140+
"westus",
141+
"westus2",
142+
"westus2stage",
143+
"westus3",
144+
"westusstage"
145+
]
146+
},
147+
"Environment": {
148+
"Type": "UserInput",
149+
"Description": "The Type of environment that will be created. (e.g. 'dev', 'test', 'qa', 'staging', 'prod')",
150+
"Targets": [
151+
{
152+
"Name": "parEnvironment",
153+
"Destination": "Parameters"
154+
}
155+
],
156+
"Value": "",
157+
"DefaultValue": "prod",
158+
"Valid": "^[a-zA-Z0-9]{2,10}$"
159+
},
160+
"IdentitySubscriptionId": {
161+
"Type": "UserInput",
162+
"Description": "The identifier of the Identity Subscription. (e.g '00000000-0000-0000-0000-000000000000')",
163+
"Valid": "^( {){0,1}[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}(}){0,1}$",
164+
"Targets": [
165+
{
166+
"Name": "IdentitySubscriptionId",
167+
"Destination": "Environment"
168+
}
169+
],
170+
"Value": ""
171+
},
172+
"ConnectivitySubscriptionId": {
173+
"Type": "UserInput",
174+
"Description": "The identifier of the Connectivity Subscription. (e.g '00000000-0000-0000-0000-000000000000')",
175+
"Valid": "^( {){0,1}[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}(}){0,1}$",
176+
"Targets": [
177+
{
178+
"Name": "ConnectivitySubscriptionId",
179+
"Destination": "Environment"
180+
}
181+
],
182+
"Value": ""
183+
},
184+
"ManagementSubscriptionId": {
185+
"Type": "UserInput",
186+
"Description": "The identifier of the Management Subscription. (e.g 00000000-0000-0000-0000-000000000000)",
187+
"Valid": "^( {){0,1}[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}(}){0,1}$",
188+
"Targets": [
189+
{
190+
"Name": "ManagementSubscriptionId",
191+
"Destination": "Environment"
192+
}
193+
],
194+
"Value": ""
8195
},
9-
"03.customRoleDefinitions": {
10-
"source": "infra-as-code/bicep/modules/customRoleDefinitions/customRoleDefinitions.bicep"
196+
"BillingAccountId": {
197+
"Type": "UserInput",
198+
"Description": "The identifier of the Billing Account. (e.g 00000000-0000-0000-0000-000000000000)",
199+
"Valid": "^( {){0,1}[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}(}){0,1}$",
200+
"Value": ""
11201
},
12-
"04.logging": {
13-
"source": "infra-as-code/bicep/module/logging/logging.bicep"
202+
"EnrollmentAccountId": {
203+
"Type": "UserInput",
204+
"Description": "The identifier of the Enrollment Account. (e.g 00000000-0000-0000-0000-000000000000)",
205+
"Valid": "^( {){0,1}[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}(}){0,1}$",
206+
"Value": ""
14207
},
15-
"04-1.mgdiagnostics": {
16-
"source": "infra-as-code/bicep/orchestration/mgDiagSettingsAll/mgDiagSettingsAll.bicep"
208+
"LogAnalyticsResourceId": {
209+
"Type": "Computed",
210+
"Value": "/subscriptions/{%ManagementSubscriptionId%}/resourcegroups/alz-logging/providers/microsoft.operationalinsights/workspaces/alz-log-analytics",
211+
"Targets": [
212+
{
213+
"Name": "parLogAnalyticsWorkspaceResourceId",
214+
"Destination": "Parameters"
215+
}
216+
]
17217
}
18-
},
19-
"custom_modules" : {
20-
21218
}
22219
}

0 commit comments

Comments
 (0)