Skip to content

Instantly share code, notes, and snippets.

@forki
Created March 17, 2014 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save forki/9595700 to your computer and use it in GitHub Desktop.
Save forki/9595700 to your computer and use it in GitHub Desktop.
Start IIS
// --------------------------------------------------------------------------------------
// FAKE build script
// --------------------------------------------------------------------------------------
#r @"packages/FAKE/tools/FakeLib.dll"
#r @"packages/FAKE/tools/Fake.IIS.dll"
open Fake
open Fake.Git
open Fake.AssemblyInfoFile
open Fake.ReleaseNotesHelper
open Fake.IISExpress
open System
let project = "msu.Perception"
let summary = "msu.Perception is a web app"
let description = "msu.Perception is a web app"
let authors = ["Steffen Forkmann"; "Nils Grimmer"; "Matthias Machwig"]
let tags = "web mvc process"
let hostName = "localhost"
let port = 51100
let solutionFile = "msu.Perception"
let testAssemblies = "tests/**/bin/Release/*.Tests*.dll"
let nugetDir = "./nuget/"
let websiteDir = "./temp/website/"
// Read additional information from the release notes document
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
let release = parseReleaseNotes (IO.File.ReadAllLines "RELEASE_NOTES.md")
Target "AssemblyInfo" (fun _ ->
let fileName = "src/" + project + "/Properties/AssemblyInfo.cs"
CreateCSharpAssemblyInfo fileName
[ Attribute.Title project
Attribute.Product project
Attribute.Description summary
Attribute.Version release.AssemblyVersion
Attribute.FileVersion release.AssemblyVersion ]
)
Target "RestorePackages" RestorePackages
Target "Clean" (fun _ ->
CleanDirs ["bin"; "temp"; nugetDir]
)
Target "Build" (fun _ ->
!! "/**/*.csproj"
|> BuildWebsites websiteDir
)
Target "StartWebSite" (fun _ ->
let config = createConfigFile(project, 1, "iisexpress-template.config", websiteDir + "/" + project, hostName, port)
HostWebsite id config 1 |> ignore
)
Target "StopWebSite" (fun _ ->
killProcess "iisexpress"
)
Target "OpenBrowser" (fun _ ->
OpenWebsiteInBrowser hostName port
)
// --------------------------------------------------------------------------------------
// Run all targets by default. Invoke 'build <Target>' to override
Target "All" DoNothing
"StopWebSite"
==> "Clean"
==> "RestorePackages"
==> "AssemblyInfo"
==> "Build"
==> "All"
"All"
==> "StartWebSite"
==> "OpenBrowser"
RunTargetOrDefault "All"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment