-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/fsharp/FAKE
- Loading branch information
Showing
14 changed files
with
468 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# FAKE.IIS | ||
|
||
FAKE.IIS provides extensions around the Microsoft.Web.Administration library to provide clean interfaces to easily configure IIS Sites and Application Pools. | ||
|
||
## Creating a ApplicationPool and Site | ||
#r "Fake.IIS.dll" | ||
#load "IISHelper.fs" | ||
|
||
open Fake.IISHelper | ||
|
||
let siteName = "fake.site" | ||
let appPoolName = "fake.appPool" | ||
let port = ":80:" | ||
let path = @"C:\inetpub\wwwroot" | ||
|
||
let siteConfig = SiteConfig(siteName, port, path, appPoolName) | ||
let appPoolConfig = ApplicationPoolConfig(appPoolName) | ||
|
||
(IIS | ||
(Site siteConfig) | ||
(ApplicationPool appPoolConfig) | ||
(None)) | ||
|
||
## Deleting an Application Pool and Site | ||
#r "Fake.IIS.dll" | ||
|
||
#load "IISHelper.fs" | ||
|
||
open Fake.IISHelper | ||
|
||
let siteName = "fake.site" | ||
let appPoolName = "fake.appPool" | ||
|
||
deleteSite siteName | ||
deleteApplicationPool appPool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,50 @@ | ||
module Fake.AppConfig | ||
|
||
open System | ||
open System.IO | ||
open System.Configuration | ||
open System.Collections.Generic | ||
|
||
type Authorization = | ||
| Off | ||
| On | ||
|
||
let HasKey name = | ||
ConfigurationManager.AppSettings.AllKeys | ||
|> Seq.exists(fun key -> key = name) | ||
let mutable appSettings = ConfigurationManager.AppSettings | ||
|
||
let HasKey name = | ||
ConfigurationManager.AppSettings.AllKeys | ||
|> Seq.exists (fun key -> key = name) | ||
|
||
let Key<'T>(name : string) = | ||
let value = ConfigurationManager.AppSettings.[name] | ||
let value = appSettings.[name] | ||
Convert.ChangeType(value, typedefof<'T>) :?> 'T | ||
|
||
let WorkDirectory = | ||
match (HasKey "WorkDirectory") with | ||
| false -> "." | ||
| true -> Key<string> "WorkDirectory" | ||
|> Path.GetFullPath | ||
|
||
let LogDirectory = | ||
match (HasKey "LogDirectory") with | ||
| false -> WorkDirectory | ||
| true -> | ||
let dir = Key<string> "LogDirectory" | ||
if dir.StartsWith("~") then dir.Replace("~", WorkDirectory) | ||
else dir | ||
|> Path.GetFullPath | ||
|
||
let AuthorizedKeysFile = Key<string> "AuthorizedKeysFile" | ||
|
||
let Authorization = | ||
let Authorization = | ||
let keyName = "Authorization" | ||
match (HasKey keyName) with | ||
| false -> Off | ||
| true -> | ||
| true -> | ||
match (Key<string> keyName).ToLower() with | ||
| "on" -> On | ||
| "off" -> Off | ||
| x -> failwith (sprintf "'%s' is not a valid value for Authorization" x) | ||
|
||
let ServerName = Key<string> "ServerName" | ||
|
||
let Port = Key<string> "Port" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.