-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.ps1
More file actions
40 lines (35 loc) · 1.05 KB
/
deploy.ps1
File metadata and controls
40 lines (35 loc) · 1.05 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
param(
$siteName,
$hostName = "*:80:",
$webdir = "C:\inetpub\wwwroot",
$clean
)
if([string]::IsNullOrEmpty($hostName) -or [string]::IsNullOrEmpty($siteName)) {
Write-Host ""
Write-Host "Missing required arguments!" -ForegroundColor Red
Write-Host ""
Write-Host "Examples:"
Write-Host ""
Write-Host "deploy -siteName mySite -hostName localhost"
Write-Host ""
Write-Host " -siteName New site name to be created"
Write-Host " -hostName hostname for site"
Write-Host " -webdir Directory root for IIS Site (default C:\inetpub\wwwroot)"
Write-Host " -clean Delete site (default false)"
exit 1
}
# load helper functions
. .\functions.ps1
# stop on errors
$ErrorActionPreference = "Stop"
if ($clean -eq $true) {
removeIISSite $siteName
removeAppPool $siteName
removeAppDirectory $webdir $siteName
Write-Host "cleaning completed" -ForegroundColor Green
exit 0
}
createAppDirectory $webdir $siteName
createAppPool $siteName
createIISSite $webdir $siteName $hostName
Write-Host "deploy completed" -ForegroundColor Green