forked from bcgov/mds
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmds.ps1
More file actions
41 lines (38 loc) · 909 Bytes
/
mds.ps1
File metadata and controls
41 lines (38 loc) · 909 Bytes
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
#Wait until docker has started, then build the MDS app with local development settings
$timeout_minutes = 10
function Check-Port {
param (
[int]$port
)
$connection = New-Object System.Net.Sockets.TcpClient('localhost',$port)
$connection.Connected
}
function Check-Docker {
$ErrorActionPreference = "Stop"
try{
$garbage = docker ps
$true
}
catch{
$false
}
finally{
$ErrorActionPreference = "Continue"
}
}
$Running = Check-Docker
$count = 0
while ($Running -ne $true) {
if($count -ge $timeout_minutes){
write-host 'Timeout!'
Exit-PSSession
}
write-host 'Waiting for Docker to start... (this may take a while)'
Start-Sleep -seconds 60
$Running = Check-Docker
$count++
}
write-host 'Docker started...'
write-host 'Cleaning...'
$ErrorActionPreference = "Continue"
make rebuild-all-local