-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ps1
60 lines (49 loc) · 1.73 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
$ErrorActionPreference = "Continue"
$dnvm = Join-Path $env:USERPROFILE -ChildPath "\.dnx\bin\"
$dnx = Join-Path $env:USERPROFILE -ChildPath "\.dnx\runtimes\dnx-clr-win-x64.1.0.0-beta8\bin\"
$env:Path += ";" + $dnvm + ";" + $dnx
function Install-Environment {
&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}
dnvm install 1.0.0-beta8 -arch x64 -runtime clr
dnvm list
}
function Restore-Dependencies {
dnu restore src
}
function Run-UnitTests {
# todo
}
function Run-ServiceTests {
# start the service in the background
$cwd = Get-Location
Start-Job -Name ConversionService -ScriptBlock ({param($path)
Set-Location -Path $path
.\tmp\service\approot\web.cmd
}) -ArgumentList $cwd
# wait until the service is started; we could probably ping the service to ensure it's started
Start-Sleep -Seconds 5
# run the service tests
dnx -p .\test\Service\ServiceTests\project.json test
# stop the job and also write the output
Get-Job -Name ConversionService | Stop-Job
Get-Job -Name ConversionService | Receive-Job
}
function Invoke-Build {
dnu restore .\src\Service\project.json
dnu restore .\test\Service\ServiceTests\project.json
dnu publish .\src\Service\project.json --out .\tmp\service --no-source --runtime dnx-clr-win-x64.1.0.0-beta8 --configuration Release --quiet
}
function Create-TempDirectories {
if (Test-Path tmp) {
Remove-Item tmp -Force -Recurse
}
mkdir tmp
mkdir tmp\input
mkdir tmp\output
}
Install-Environment
Restore-Dependencies
Create-TempDirectories
Invoke-Build
Run-UnitTests
Run-ServiceTests