-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.ps1
60 lines (50 loc) · 1.28 KB
/
build.ps1
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
#requires -version 7
[cmdletbinding()]
param (
[Parameter(Mandatory = $True)]
[string[]]$NodeList,
[switch]$Configure
)
# Append .ini to filename if missing
for ($i = 0; $i -lt $NodeList.Count; $i++)
{
$file = $NodeList[$i]
if ($file.IndexOf(".ini") -eq -1)
{
$NodeList[$i] = $file + ".ini"
}
}
# Test for each config file
$missing = $false
foreach ($config IN $NodeList)
{
if (!(Test-Path -Path "$config"))
{
Write-Host -ForegroundColor Yellow "`n Missing Node Configuration File [$config]"
$missing = $true
}
}
if ($missing) { Write-Host; exit }
# Deploy Node(s)
Clear-Host
Write-Host -ForegroundColor Gray " ================================"
Write-Host -ForegroundColor Yellow " StorageGRID Deployment - vSphere"
Write-Host -ForegroundColor Gray " ================================"
foreach ($config IN $NodeList)
{
& "./deploy.ps1" -ConfigFile $config.Trim()
if ($LASTEXITCODE -ne 0) { EXIT }
}
Write-Host
if ($NodeList.Count -gt 1 ) {
Write-Host
Write-Host -ForegroundColor Yellow " Waiting ~5 minutes for last node to finish booting ... " -NoNewline
Start-Sleep -Seconds 310
Write-Host -ForegroundColor Green "Done"
Write-Host
}
# Configure Nodes
if ($Configure) {
& "./configure.ps1"
}
# END