-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp-setup-dev.ps1
More file actions
72 lines (61 loc) · 2.93 KB
/
app-setup-dev.ps1
File metadata and controls
72 lines (61 loc) · 2.93 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
########################################################################
### 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. #####################################################
########################################################################
$websiteProject = "Escc.SupportWithConfidence.Website"
$adminProject = "Escc.SupportWithConfidence.Admin"
$etlProject = "Escc.SupportWithConfidence.ETL"
$apiProject = "Escc.SupportWithConfidence.WebApi"
DownloadProjectIfMissing $parentFolderOfThisScript "Escc.EastSussexGovUK"
# Front-end website
EnableDotNet40InIIS
CreateApplicationPool $websiteProject
CreateWebsite $websiteProject "$pathOfThisScript\$websiteProject"
CreateHTTPSBinding $websiteProject "localhost"
CopyConfig "$websiteProject\Web.example.config" "$websiteProject\web.config"
# Admin website
CreateApplicationPool $adminProject
CreateWebsite $adminProject "$pathOfThisScript\$adminProject"
CreateHTTPSBinding $adminProject "localhost"
DisableAnonymousAuthentication $adminProject
EnableWindowsAuthentication $adminProject
CopyConfig "$adminProject\Web.example.config" "$adminProject\web.config"
# API
CreateApplicationPool $apiProject
CreateWebsite $apiProject "$pathOfThisScript\$apiProject"
CreateHTTPSBinding $apiProject
CopyConfig "$apiProject\Web.example.config" "$apiProject\web.config"
# Configure ETL admin tool
CopyConfig "$etlProject\app.example.config" "$etlProject\app.config"
Write-Host
Write-Host "Done." -ForegroundColor "Green"
Write-Host
Write-Host "Now replace the sample values in 'app.config' and 'web.config' with ones appropriate to your setup, and build the solution." -ForegroundColor "Green"
Write-Host "You will also need to enable Windows authentication and remove anonymous authentication for the Web API site in IIS." -ForegroundColor "Green"