-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTemplate.json
358 lines (358 loc) · 13.6 KB
/
Template.json
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
{
"Name": "TeamCity",
"Description": "Installs and configures TeamCity server.",
"Version": "1.0.0",
"Parameters": [
{
"Name": "Region",
"Type": "String",
"TypeHint": "AzureRegionName",
"Description": "Azure region to which the infrastructure will be deployed."
},
{
"Name": "AffinityGroup",
"Type": "String",
"TypeHint": "AzureAffinityGroupName",
"Description": "Azure affinity group to which the infrastructure will be deployed."
},
{
"Name": "DiskStore",
"Type": "String",
"TypeHint": "AzureStorageName",
"Description": "Name of Azure storage account for creating VM disks. Will be created only if it does not already exists. If it exists then it should lie in the specified affinity group."
},
{
"Name": "TeamCityCloudService",
"Type": "String",
"TypeHint": "AzureCloudServiceName",
"Description": "Name of the Azure Cloud Service to which Teamcity VM is to be deployed. Will be created only if it does not already exists. If it exists then it should lie in the specified affinity group."
},
{
"Name": "VMSize",
"Type": "String",
"TypeHint": "AzureRoleSize",
"Description": "Size of the Teamcity VM.",
"Default": "Small"
},
{
"Name": "AdminName",
"Type": "String",
"TypeHint": "username",
"Description": "Name of local administrator account.",
"Minimum": 1,
"Maximum": 64
},
{
"Name": "AdminPassword",
"Type": "String",
"TypeHint": "password",
"Description": "Password of local administrator account.",
"MaskValue": true,
"Minimum": 8,
"Maximum": 127
},
{
"Name": "TeamCityVersion",
"Type": "String",
"Description": "Product Version of TeamCity.",
"Default": "8.1.5"
},
{
"Name": "TeamCityConnectionPort",
"Type": "Number",
"Description": "Port for accessing of TeamCity Web UI.",
"Default": 8111
},
{
"Name": "TeamCityDataDiskSizeInGB",
"Type": "Number",
"Description": "Disk size for TeamCity data directory.",
"Default": 40
},
{
"Name": "UseInternalHSQLDBEngine",
"Type": "Boolean",
"Description": "Specifies whether to create Teamcity database using the internal HSQLDB database engine.",
"TypeHint": "boolean",
"Default": "true"
}
],
"Network": {
"DnsServers": [],
"LocalSites": [],
"VirtualSites": [],
"ReservedIPs": []
},
"AffinityGroup": {
"Name": "{{AffinityGroup}}",
"Region": "{{Region}}",
"Label": "Created by Brewmaster"
},
"StorageAccounts": [
{
"Name": "{{DiskStore}}",
"AffinityGroup": "{{AffinityGroup}}",
"Region": "{{Region}}",
"Description": "A non-georedundant disk store",
"DisableGeoReplication": true
}
],
"CloudServices": [
{
"Name": "{{TeamCityCloudService}}",
"AffinityGroup": "{{AffinityGroup}}",
"Region": "{{Region}}",
"Description": "Teamcity Setup",
"Deployment": {
"VirtualMachines": [
{
"Name": "teamcity1",
"RoleSize": "{{VMSize}}",
"AvailabilitySet": "teamcity-avs",
"OsVirtualDisk": {
"OsType": "Windows",
"OsImageName": "a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-*"
},
"DataVirtualDisks": [
{
"DiskId": "disk0",
"Lun": 0,
"LogicalSizeInGB": "{{TeamCityDataDiskSizeInGB}}"
}
],
"WindowsConfigSet": {
"LocalAdminCredentialId": "vmadmin",
"EnableAutomaticUpdates": false,
"ChangePasswordAtLogon": false,
"DisableRdp": false
},
"ConfigSets": [
"TeamcityServer"
]
}
],
"DiskStorageAccount": "{{DiskStore}}"
}
}
],
"Credentials": [
{
"Name": "vmadmin",
"UserName": "{{AdminName}}",
"Password": "{{AdminPassword}}"
}
],
"ConfigSets": [
{
"Name": "TeamcityServer",
"Description": "Teamcity server",
"Endpoints": [
{
"Name": "TeamcityWebUI",
"LocalPort": "{{TeamCityConnectionPort}}",
"Protocol": "tcp",
"Port": "{{TeamCityConnectionPort}}"
}
],
"ConfigurationIds": [
"SetupJDK",
"InstallTeamCity",
"ConfigureTeamCity",
"SetupDotNetCloudBuildEnvironment"
]
}
],
"Configurations": [
{
"Name": "SetupJDK",
"Description": "Install and configure JDK.",
"Resources": [
{
"Type": "File",
"ImportModule": null,
"ImportTypeName": null,
"Name": "JDKSetupFolder",
"Args": {
"Type": "Directory",
"DestinationPath": "C:\\JDKSetup",
"Ensure": "Present"
}
},
{
"Credential": "vmadmin",
"GetScript": "return @{ Downloaded = Test-Path -LiteralPath \"C:\\JDKSetup\\jdk1.8.0_11.zip\" -PathType Leaf }",
"SetScript": "Write-Verbose \"Downloading JDK...\" -Verbose\r\nInvoke-WebRequest 'http://apselasticsearchdev.blob.core.windows.net/brewmasterinstallers/jdk1.8.0_11.zip' -OutFile \"C:\\JDKSetup\\jdk1.8.0_11.zip\"",
"TestScript": "if (Test-Path -LiteralPath \"C:\\JDKSetup\\jdk1.8.0_11.zip\" -PathType Leaf)\r\n{Write-Verbose \"C:\\JDKSetup\\jdk1.8.0_11.zip already exists.\" -Verbose\r\nreturn $true}\r\nreturn $false",
"Type": "Script",
"ImportModule": null,
"ImportTypeName": null,
"Name": "DownloadJDK",
"Requires": [
"[File]JDKSetupFolder"
]
},
{
"Type": "Archive",
"ImportModule": null,
"ImportTypeName": null,
"Name": "UnpackJDK",
"Args": {
"Path": "C:\\JDKSetup\\jdk1.8.0_11.zip",
"Destination": "%ProgramFiles%",
"Ensure": "Present"
},
"Requires": [
"[Script]DownloadJDK"
]
},
{
"Type": "Environment",
"ImportModule": null,
"ImportTypeName": null,
"Name": "SetJavaHome",
"Args": {
"Name": "JAVA_HOME",
"Value": "%ProgramFiles%\\jdk1.8.0_11\\",
"Ensure": "Present"
},
"Requires": [
"[Archive]UnpackJDK"
]
}
]
},
{
"Name": "InstallTeamCity",
"Description": "Teamcity server installation",
"Resources": [
{
"Type": "xFormatDisks",
"ImportModule": "xAzureDataDisks",
"ImportTypeName": "ADITI_xFormatDisks",
"Name": "FormatRawDisks",
"Args": {
"FirstDriveLetter": "F"
}
},
{
"Type": "Package",
"ImportModule": null,
"ImportTypeName": null,
"Name": "SevenZipTool",
"Args": {
"Path": "http://downloads.sourceforge.net/sevenzip/7z920.msi",
"Name": "7-Zip 9.20",
"ProductId": "",
"Arguments": "LicenseAccepted=1",
"Ensure": "Present"
}
},
{
"Type": "xFirewall",
"ImportModule": "xNetworking",
"ImportTypeName": "MSFT_xFirewall",
"Name": "OpenWebAccessPort",
"Args": {
"Name": "TeamcityWebAccess",
"Description": "Teamcity online portal access",
"LocalPort": "{{TeamCityConnectionPort}}",
"Protocol": "TCP",
"Access": "Allow",
"State": "Enabled",
"Direction": "Inbound"
}
},
{
"Type": "xInstallTeamCity",
"ImportModule": "xTeamCity",
"ImportTypeName": "ADITI_xInstallTeamCity",
"Name": "InstallAndStartTeamCity",
"Args": {
"DataDirectoryName": "TeamCityData",
"DataDiskDriveLetter": "F",
"ProductVersion": "{{TeamCityVersion}}",
"TeamCityConnectionPort": "%%{{TeamCityConnectionPort}}"
},
"Requires": [
"[xFormatDisks]FormatRawDisks",
"[Package]SevenZipTool"
]
}
]
},
{
"Name": "ConfigureTeamCity",
"Description": "Configure Teamcity server",
"Resources": [
{
"Type": "xWaitForTeamCityService",
"ImportModule": "xTeamCity",
"ImportTypeName": "ADITI_xWaitForTeamCityService",
"Name": "WaitForTeamCityService",
"Args": {
"RetryCount": "%%10",
"RetryIntervalSec": "%%12",
"TeamCityConnectionPort": "%%{{TeamCityConnectionPort}}"
}
},
{
"Type": "xTeamCityFirstStart",
"ImportModule": "xTeamCity",
"ImportTypeName": "ADITI_xTeamCityFirstStart",
"Name": "TeamCityFirstStart",
"Args": {
"TeamCityConnectionPort": "%%{{TeamCityConnectionPort}}"
},
"Requires": [
"[xWaitForTeamCityService]WaitForTeamCityService"
]
},
{
"Type": "xTeamCityDbSetup",
"ImportModule": "xTeamCity",
"ImportTypeName": "ADITI_xTeamCityDbSetup",
"Name": "TeamCityDbSetup",
"Args": {
"TeamCityConnectionPort": "%%{{TeamCityConnectionPort}}",
"UseInternalDb": "%%${{UseInternalHSQLDBEngine}}"
},
"Requires": [
"[xTeamCityFirstStart]TeamCityFirstStart"
]
}
]
},
{
"Name": "SetupDotNetCloudBuildEnvironment",
"Description": "Setup build environment via installing requisite dependencies for building and deploying .NET cloud projects.",
"Resources": [
{
"Type": "Package",
"ImportModule": null,
"ImportTypeName": null,
"Name": "InstallWebPI",
"Args": {
"Credential": "vmadmin",
"Name": "Microsoft Web Platform Installer 4.6",
"ProductId": "16C7D2AD-20CA-491E-80BC-8607A9AACED9",
"Path": "http://download.microsoft.com/download/7/0/4/704CEB4C-9F42-4962-A2B0-5C84B0682C7A/WebPlatformInstaller_amd64_en-US.msi",
"LogPath": "%BrewmasterDir%\\Logs\\WebPlatformInstaller_amd64_en-US.log",
"Ensure": "Present"
}
},
{
"Credential": "vmadmin",
"Type": "ScriptFile",
"ImportModule": null,
"ImportTypeName": null,
"Name": "InstallAzurePowershell",
"ScriptFileName": "InstallProduct.ps1",
"Args": "-ProductId \"WindowsAzurePowershell\" -Log \"$env:BrewmasterDir\\Logs\\WindowsAzurePowershell.log\"",
"Requires": [
"[Package]InstallWebPI"
]
}
]
}
]
}