-
Notifications
You must be signed in to change notification settings - Fork 0
/
app-setup-dev.ps1
50 lines (43 loc) · 2.09 KB
/
app-setup-dev.ps1
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
########################################################################
### BOOTSTRAP. Copy this section into each application setup script ###
### to make sure required functions are available. ###
########################################################################
$pathOfThisScript = Split-Path $MyInvocation.MyCommand.Path -Parent
$parentFolderOfThisScript = $pathOfThisScript | Split-Path -Parent
$scriptsProject = 'Escc.WebApplicationSetupScripts'
$functionsPath = "$pathOfThisScript\..\$scriptsProject\functions.ps1"
if (Test-Path $functionsPath) {
Write-Host "Checking $scriptsProject is up-to-date"
Push-Location "$pathOfThisScript\..\$scriptsProject"
git pull origin master
Pop-Location
Write-Host
.$functionsPath
} else {
if ($env:GIT_ORIGIN_URL) {
$repoUrl = $env:GIT_ORIGIN_URL -f $scriptsProject
git clone $repoUrl "$pathOfThisScript\..\$scriptsProject"
}
else
{
Write-Warning '$scriptsProject project not found. Please set a GIT_ORIGIN_URL environment variable on your system so that it can be downloaded.
Example: C:\>set GIT_ORIGIN_URL=https://example-git-server.com/{0}"
{0} will be replaced with the name of the repository to download.'
Exit
}
}
########################################################################
### END BOOTSTRAP. #####################################################
########################################################################
$projectName = "Escc.WebsiteStyleGuide"
EnableDotNet40InIIS
CreateApplicationPool $projectName
CreateWebsite $projectName "$pathOfThisScript\$projectName"
CreateHTTPSBinding $projectName "localhost"
CreateVirtualDirectory $projectName "img" "$parentFolderOfThisScript\Escc.EastSussexGovUK\Escc.EastSussexGovUK\img" true
CopyConfig "$projectName\Web.example.config" "$projectName\web.config"
CopyConfig "$projectName\Views\Web.example.config" "$projectName\Views\web.config"
Write-Host
Write-Host "Done." -ForegroundColor "Green"
Write-Host
Write-Host "Now replace the sample values in `web.config` with ones appropriate to your setup, and build the solution." -ForegroundColor "Green"