Add additional files to improve testing process
This commit is contained in:
parent
2e5fb2104c
commit
35ee7a2be0
7 changed files with 131 additions and 0 deletions
12
WebsitePanel/Tools/SetupTestWebsites.ps1
Normal file
12
WebsitePanel/Tools/SetupTestWebsites.ps1
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
Import-Module WebAdministration
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
$path = pwd
|
||||||
|
cd Tools
|
||||||
|
|
||||||
|
New-Website -Name "WebsitePanel Server" -Port 9003 -PhysicalPath "$path\Sources\WebsitePanel.Server" -ErrorAction SilentlyContinue
|
||||||
|
New-Website -Name "WebsitePanel Enterprise Server" -Port 9002 -PhysicalPath "$path\Sources\WebsitePanel.EnterpriseServer" -ErrorAction SilentlyContinue
|
||||||
|
New-Website -Name "WebsitePanel Portal" -Port 9001 -PhysicalPath "$path\Sources\WebsitePanel.WebPortal" -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
|
|
||||||
|
|
33
WebsitePanel/Tools/StartWebsite.ps1
Normal file
33
WebsitePanel/Tools/StartWebsite.ps1
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
Write-Host -ForegroundColor Green "
|
||||||
|
Ensure that you have created the EnterpriseServer Database
|
||||||
|
by executing test-createDB.bat and compiled WebsitePanel by
|
||||||
|
executing build-test.bat .
|
||||||
|
|
||||||
|
Configuration:
|
||||||
|
|
||||||
|
WebsitePanel Portal:
|
||||||
|
|
||||||
|
URL: http://localhost:9001
|
||||||
|
Login: serveradmin
|
||||||
|
Password: 1234
|
||||||
|
|
||||||
|
|
||||||
|
WebsitePanel Enterprise Server:
|
||||||
|
URL: http://localhost:9002
|
||||||
|
Database Login: WebsitePanel
|
||||||
|
Database Password: Password12
|
||||||
|
|
||||||
|
|
||||||
|
WebsitePanel Server:
|
||||||
|
URL: http://localhost:9003
|
||||||
|
Password: Password12
|
||||||
|
"
|
||||||
|
|
||||||
|
start http://localhost:9001
|
||||||
|
|
||||||
|
Read-Host "Press a key"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
2
WebsitePanel/Tools/build-test.bat
Normal file
2
WebsitePanel/Tools/build-test.bat
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe ..\test.xml /target:BuildTest /property:BuildConfiguration=Debug /v:n /fileLogger /m
|
||||||
|
Pause
|
3
WebsitePanel/Tools/start-test.bat
Normal file
3
WebsitePanel/Tools/start-test.bat
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
@echo off
|
||||||
|
powershell . ".\StartWebsite.ps1"
|
||||||
|
Pause
|
1
WebsitePanel/Tools/test-createDB.bat
Normal file
1
WebsitePanel/Tools/test-createDB.bat
Normal file
|
@ -0,0 +1 @@
|
||||||
|
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe ..\test.xml /target:CreateTestDB /property:BuildConfiguration=Debug /v:n /fileLogger /m
|
1
WebsitePanel/Tools/test-updateDB.bat
Normal file
1
WebsitePanel/Tools/test-updateDB.bat
Normal file
|
@ -0,0 +1 @@
|
||||||
|
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe ..\test.xml /target:UpdateTestDB /property:BuildConfiguration=Debug /v:n /fileLogger /m
|
79
WebsitePanel/test.xml
Normal file
79
WebsitePanel/test.xml
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
|
||||||
|
<Import Project="build.xml" />
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TestDatabase>WebsitePanel</TestDatabase>
|
||||||
|
<TestDatabaseFolder>$(BuildFolder)\Database</TestDatabaseFolder>
|
||||||
|
<TestDbLogin>WebsitePanel</TestDbLogin>
|
||||||
|
<TestDbPassword>Password12</TestDbPassword>
|
||||||
|
<TestServerAdminPassword>1234</TestServerAdminPassword>
|
||||||
|
<TestServerAdminEncryptedPassword>HcWzSyyxfo0751w/TwWUjQ==</TestServerAdminEncryptedPassword>
|
||||||
|
<TestServerPassword>Password12</TestServerPassword>
|
||||||
|
<TestCryptoKey>1234567890</TestCryptoKey>
|
||||||
|
<EnterpriseUrl>http://127.0.0.1:9002</EnterpriseUrl>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<Target Name="ConfigTest" DependsOnTargets="Build">
|
||||||
|
<XmlUpdate XmlFileName="$(ServerInstall)\web.config" Xpath="//configuration/websitepanel.server/security/password/@value" Value="$(TestServerPassword)" />
|
||||||
|
<XmlUpdate XmlFileName="$(EnterpriseServerInstall)\web.config" Xpath="//configuration/connectionStrings/add/@connectionString" Value="Server=(local)\SQLExpress;Database=$(TestDatabase);uid=$(TestDbLogin);pwd=$(TestDbPassword);" />
|
||||||
|
<XmlUpdate XmlFileName="$(EnterpriseServerInstall)\web.config" Xpath="//configuration/appSettings/add[@key=%22WebsitePanel.CryptoKey%22]/@value" Value="$(TestCryptoKey)" />
|
||||||
|
<XmlUpdate XmlFileName="$(PortalInstall)\App_Data\SiteSettings.config" Xpath="//SiteSettings/EnterpriseServer" Value="$(EnterpriseUrl)" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="CreateIISWebsites" DependsOnTargets="ConfigTest">
|
||||||
|
<Exec Command="powershell . ".\Tools\SetupTestWebsites.ps1"" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="StartWebsite" DependsOnTargets="CreateIISWebsites">
|
||||||
|
<Exec Command="powershell . ".\Tools\StartWebsite.ps1"" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="BuildTest" DependsOnTargets="CreateIISWebsites">
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="Test" DependsOnTargets="BuildTest;StartWebsite">
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="UpdateTestDB">
|
||||||
|
<MakeDir Directories="$(TestDatabaseFolder)"/>
|
||||||
|
|
||||||
|
<Copy SourceFiles="$(TrunkFolder)\Database\update_db.sql" DestinationFolder="$(TestDatabaseFolder)" />
|
||||||
|
|
||||||
|
<!-- Update variables in files -->
|
||||||
|
<FileUpdate Files="$(TestDatabaseFolder)\update_db.sql" Regex="\${install.database}" ReplacementText="$(TestDatabase)" />
|
||||||
|
<FileUpdate Files="$(TestDatabaseFolder)\update_db.sql" Regex="\${release.version}" ReplacementText="$(FileVersion)" />
|
||||||
|
<FileUpdate Files="$(TestDatabaseFolder)\update_db.sql" Regex="\${release.date}" ReplacementText="$(ReleaseDate)" />
|
||||||
|
|
||||||
|
<Exec Command="$(SqlCmd) -i $(TestDatabaseFolder)\update_db.sql" />
|
||||||
|
|
||||||
|
<Delete Files="$(TestDatabaseFolder)\install_db.sql" />
|
||||||
|
<Delete Files="$(TestDatabaseFolder)\update_db.sql" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="CreateTestDB">
|
||||||
|
<MakeDir Directories="$(TestDatabaseFolder)"/>
|
||||||
|
|
||||||
|
<Exec Command="$(SqlCmd) -Q "IF DB_ID (N'$(TestDatabase)') IS NOT NULL DROP LOGIN $(TestDbLogin)"" />
|
||||||
|
<Exec Command="$(SqlCmd) -Q "IF DB_ID (N'$(TestDatabase)') IS NOT NULL DROP DATABASE $(TestDatabase)"" />
|
||||||
|
<Exec Command="$(SqlCmd) -Q "CREATE DATABASE $(TestDatabase)"" />
|
||||||
|
<Exec Command="$(SqlCmd) -Q "CREATE LOGIN $(TestDbLogin) WITH PASSWORD='$(TestDbPassword)', DEFAULT_DATABASE=$(TestDatabase);USE $(TestDatabase);EXEC sp_changedbowner '$(TestDbLogin)';"" />
|
||||||
|
|
||||||
|
<Copy SourceFiles="$(TrunkFolder)\Database\install_db.sql" DestinationFolder="$(TestDatabaseFolder)" />
|
||||||
|
<Copy SourceFiles="$(TrunkFolder)\Database\update_db.sql" DestinationFolder="$(TestDatabaseFolder)" />
|
||||||
|
|
||||||
|
<!-- Update variables in files -->
|
||||||
|
<FileUpdate Files="$(TestDatabaseFolder)\install_db.sql" Regex="\${install.database}" ReplacementText="$(TestDatabase)" />
|
||||||
|
<FileUpdate Files="$(TestDatabaseFolder)\install_db.sql" Regex="N'serveradmin', N''" ReplacementText="N'serveradmin', N'$(TestServerAdminEncryptedPassword)'" />
|
||||||
|
<FileUpdate Files="$(TestDatabaseFolder)\update_db.sql" Regex="\${install.database}" ReplacementText="$(TestDatabase)" />
|
||||||
|
<FileUpdate Files="$(TestDatabaseFolder)\update_db.sql" Regex="\${release.version}" ReplacementText="$(FileVersion)" />
|
||||||
|
<FileUpdate Files="$(TestDatabaseFolder)\update_db.sql" Regex="\${release.date}" ReplacementText="$(ReleaseDate)" />
|
||||||
|
|
||||||
|
<Exec Command="$(SqlCmd) -i $(TestDatabaseFolder)\install_db.sql" />
|
||||||
|
<Exec Command="$(SqlCmd) -i $(TestDatabaseFolder)\update_db.sql" />
|
||||||
|
|
||||||
|
<Delete Files="$(TestDatabaseFolder)\install_db.sql" />
|
||||||
|
<Delete Files="$(TestDatabaseFolder)\update_db.sql" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
</Project>
|
Loading…
Add table
Add a link
Reference in a new issue