Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
Update ASP.NET Core scripts #8
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonZiminSaritasa committed Aug 28, 2018
1 parent 9d3e42c commit e1dac38
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Config.Development.ps1.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Expand-PsakeConfiguration `
@{
Configuration = 'Debug'
WebServer = 'localhost'
SiteName = 'example.com'
SiteName = 'web.example.com'
DeployUsername = 'undefined'
DeployPassword = 'undefined'
WwwrootPath = 'C:\inetpub\wwwroot'
Expand Down
4 changes: 2 additions & 2 deletions Config.Production.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Expand-PsakeConfiguration `
@{
Configuration = 'Release'
WebServer = 'web.example.com'
SiteName = 'example.com'
WebServer = 'web.saritasa.local'
SiteName = 'web.example.com'
DeployUsername = $env:DeployUsername
DeployPassword = $env:DeployPassword
WwwrootPath = 'C:\inetpub\wwwroot'
Expand Down
6 changes: 3 additions & 3 deletions Config.Staging.ps1
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Expand-PsakeConfiguration `
@{
Configuration = 'Release'
WebServer = 'web.example.com'
SiteName = 'example.com'
WebServer = 'staging.saritasa.local'
SiteName = 'staging.example.com'
DeployUsername = $env:DeployUsername
DeployPassword = $env:DeployPassword
WwwrootPath = 'C:\inetpub\wwwroot'




DatabaseServer = 'mssql.example.com'
DatabaseServer = 'mssql-staging.example.com'
DatabaseUsername = $env:DatabaseUser
DatabasePassword = $env:DatabasePassword

Expand Down
16 changes: 8 additions & 8 deletions scripts/BuildTasks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Task pre-build -depends copy-configs, update-version -description 'Copy configs,
Task build -depends pre-build -description '* Build all projects.' `
-requiredVariables @('Configuration') `
{
# TODO: Fix solution name.

Exec { dotnet build -c $Configuration "$src\Example.sln" }

Exec { dotnet build -c $Configuration "$src\DeployDemo.sln" }

}

Expand All @@ -41,9 +41,9 @@ Task copy-configs -description 'Create configs based on App.config.template and
return
}

# TODO: Fix project name.

$projectName = 'Example.Web'

$projectName = 'DeployDemo.Web'
$templateFile = "$src\$projectName\appsettings.$Environment.json.template"
$configFile = "$src\$projectName\appsettings.$Environment.json"

Expand Down Expand Up @@ -89,8 +89,8 @@ Task update-version -description 'Replace package version in web project.' `
}


# TODO: Fix project name.
$fileName = "$src\Example\Example.csproj"

$fileName = "$src\DeployDemo.Web\DeployDemo.Web.csproj"
$lines = Get-Content $fileName
$lines | ForEach-Object { $_ -replace '<Version>[\d\.\w+-]*</Version>', "<Version>$InformationalVersion</Version>" `
-replace '<AssemblyVersion>[\d\.]*</AssemblyVersion>', "<AssemblyVersion>$MajorMinorPatch.0</AssemblyVersion>" } |
Expand All @@ -102,8 +102,8 @@ Task code-analysis -depends pre-build `
-requiredVariables @('Configuration', 'MaxWarnings') `
{
$buildParams = @("/p:Environment=$Environment")
# TODO: Fix solution name.
$solutionPath = "$src\Example.sln"

$solutionPath = "$src\DeployDemo.sln"
$logFile = "$workspace\Warnings.txt"

Exec { msbuild.exe $solutionPath '/m' '/t:Build' "/p:Configuration=$Configuration" '/verbosity:normal' '/fileLogger' "/fileloggerparameters:WarningsOnly;LogFile=$logFile" $buildParams }
Expand Down
4 changes: 2 additions & 2 deletions scripts/PublishTasks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Task publish-web -depends pre-publish -description '* Publish all web apps to sp
-requiredVariables @('Configuration', 'WebServer', 'SiteName') `
{

# TODO: Fix project name.
$projectName = 'Example.Web'

$projectName = 'DeployDemo.Web'
$packagePath = "$src\$projectName\$projectName.zip"
Copy-Item "$src\$projectName\web.config.template" "$src\$projectName\web.config"
Update-VariablesInFile -Path "$src\$projectName\web.config" -Variables @{ Environment = $Environment }
Expand Down

0 comments on commit e1dac38

Please sign in to comment.