-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.ps1
More file actions
58 lines (49 loc) · 1.7 KB
/
default.ps1
File metadata and controls
58 lines (49 loc) · 1.7 KB
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
import-module webadministration
properties {
$app_name = "playnet"
$app_port = "8000"
$verbosity = "minimal"
$sln_dir = ".\Src"
$sln = "$sln_dir\playNET.sln"
$msbuild = "C:\Program Files (x86)\MSBuild\12.0\Bin\amd64\MSBuild.exe"
$msbuild_settings = "/v:$verbosity"
$test_runner = "$sln_dir\packages\Fixie.0.0.1.120\lib\net45\Fixie.Console.exe"
$test_proj = "$sln_dir\playNET.Tests\playNET.Tests.csproj"
$test_dll = "$sln_dir\playNET.Tests\bin\Debug\playNET.Tests.dll"
$app_proj = "$sln_dir\playNET.App\playNET.App.csproj"
}
task default -depends build
task build -depends compile_sln, run_tests, package
task compile_sln {
exec { & $msbuild $msbuild_settings $sln }
}
task compile_tests {
exec { & $msbuild $msbuild_settings $test_proj }
}
task run_tests -depends compile_tests {
exec { & $test_runner $test_dll }
}
task package {
$web_deploy_settings =
"/p:DeployOnBuild=true;" +
"PublishProfile=CreatePackage"
exec { & $msbuild $msbuild_settings $web_deploy_settings $app_proj }
}
task publish -depends package, configure_iis {
exec { & ".\Bin\playNET.App.deploy.cmd" "/y" }
invoke-webrequest http://localhost:$app_port
}
task configure_iis {
if(-not(test-path "iis:\apppools\$app_name")) {
$pool = new-webapppool $app_name
$pool.processModel.identityType = 'LocalSystem'
$pool | Set-Item
}
$phys_path = "c:\inetpub\wwwroot\$app_name"
if(-not(test-path $phys_path)) {
mkdir $phys_path
}
if(-not(test-path "iis:\sites\$app_name")) {
new-website $app_name -physicalpath $phys_path -applicationpool $app_name -port $app_port
}
}