setup_iis.ps1 1.0 KB

1234567891011121314151617181920212223
  1. param($action)
  2. $wwwroot = "C:\FrameworkBenchmarks\servicestack\www"
  3. $source = "C:\FrameworkBenchmarks\servicestack\src"
  4. $msbuild = "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe"
  5. # Stop
  6. if (Get-WebSite -Name Benchmarks) { Remove-WebSite -Name Benchmarks }
  7. Get-ChildItem -Path $wwwroot -Recurse -ErrorAction 'SilentlyContinue' | Remove-Item -Force -Recurse -ErrorAction 'SilentlyContinue' | Out-Null
  8. Remove-Item -Force -Recurse $wwwroot -ErrorAction 'SilentlyContinue' | Out-Null
  9. if ($action -eq 'start') {
  10. # Create a website in IIS
  11. New-Item -Path $wwwroot -Type Directory -ErrorAction 'SilentlyContinue' | Out-Null
  12. New-WebSite -Name Benchmarks -Port 8080 -PhysicalPath $wwwroot
  13. # Build the project
  14. &$msbuild "$source\ServiceStackBenchmark.csproj" /t:RestorePackages
  15. &$msbuild "$source\ServiceStackBenchmark.csproj" /p:Configuration=Release /p:Platform="x64" /t:Clean
  16. &$msbuild "$source\ServiceStackBenchmark.csproj" /p:Configuration=Release /p:Platform="x64" /p:DeployOnBuild=true /p:PublishProfile=IIS
  17. }