Skip to content

Commit 9ecc440

Browse files
Enabled real time logging on execute command (#75)
* enabled real time logging on execute command * have logging through event * dummy commit to re process build * enforce pester version. * dummy commit * Bump version to 3.4.0.0 * Code review * Raise logevent implementation to main functions * Small fixes * Small fixes Co-authored-by: Pedro Nunes <37883272+pintonunes@users.noreply.github.com>
1 parent caea6f8 commit 9ecc440

13 files changed

Lines changed: 90 additions & 63 deletions

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Outsystems.SetupTools Release History
22

3+
## 3.4.0.0
4+
5+
- ExecuteCommand: Enabled real time logging for all executed processes. This impacts the execution of PlatformInstaller, ConfigTool, Scinstall
6+
37
## 3.3.3.0
48

59
- PlatformSetup: Now all expected files are using canonical names and code improvement

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 3.3.3.{build}
1+
version: 3.4.0.{build}
22

33
only_commits:
44
files:
@@ -8,7 +8,7 @@ only_commits:
88
install:
99
- ps: |
1010
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
11-
Install-Module Pester -MinimumVersion 3.4.0 -Scope CurrentUser -Force
11+
Install-Module Pester -RequiredVersion 4.10.1 -Scope CurrentUser -Force
1212
Install-Module psake -Scope CurrentUser -Force -RequiredVersion 4.7.4
1313
Install-Module PSScriptAnalyzer -Scope CurrentUser -Force
1414
Install-Module platyPS -Scope CurrentUser -Force

src/Outsystems.SetupTools/Functions/Get-OSPlatformDeploymentZone.ps1

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,15 @@ function Get-OSPlatformDeploymentZone
6262
$configToolArguments = "/getdeploymentzones"
6363

6464
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "Running the configuration tool. This can take a while..."
65+
66+
$onLogEvent = {
67+
param($logLine)
68+
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message $logLine
69+
}
70+
6571
try
6672
{
67-
$result = RunConfigTool -Arguments $configToolArguments
73+
$result = RunConfigTool -Arguments $configToolArguments -OnLogEvent $onLogEvent
6874
}
6975
catch
7076
{
@@ -76,11 +82,6 @@ function Get-OSPlatformDeploymentZone
7682

7783
if ($result.ExitCode -ne 0)
7884
{
79-
$confToolOutputLog = $($result.Output) -Split ("`r`n")
80-
foreach ($logline in $confToolOutputLog)
81-
{
82-
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "Configuration Tool: $logline"
83-
}
8485
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "Configuration tool exit code: $($result.ExitCode)"
8586

8687
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 3 -Message "Error getting the deployment zones. Exit code: $($result.ExitCode)"

src/Outsystems.SetupTools/Functions/Install-OSPlatformLicense.ps1

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,15 @@ function Install-OSPlatformLicense
8989
}
9090

9191
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "Installing outsytems license"
92+
93+
$onLogEvent = {
94+
param($logLine)
95+
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message $logLine
96+
}
97+
9298
try
9399
{
94-
$result = RunConfigTool -Arguments $("/UploadLicense " + [char]34 + $Path + [char]34)
100+
$result = RunConfigTool -Arguments $("/UploadLicense " + [char]34 + $Path + [char]34) -OnLogEvent $onLogEvent
95101
}
96102
catch
97103
{
@@ -101,11 +107,6 @@ function Install-OSPlatformLicense
101107
return
102108
}
103109

104-
$confToolOutputLog = $($result.Output) -Split ("`r`n")
105-
foreach ($logline in $confToolOutputLog)
106-
{
107-
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "CONFTOOL: $logline"
108-
}
109110
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "Configuration tool exit code: $($result.ExitCode)"
110111

111112
if ($result.ExitCode -ne 0)

src/Outsystems.SetupTools/Functions/Install-OSPlatformServiceCenter.ps1

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,15 @@ function Install-OSPlatformServiceCenter
106106
}
107107

108108
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "Installing Outsystems Service Center. This can take a while..."
109+
110+
$onLogEvent = {
111+
param($logLine)
112+
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message $logLine
113+
}
114+
109115
try
110116
{
111-
$result = RunSCInstaller -Arguments $scInstallerArguments
117+
$result = RunSCInstaller -Arguments $scInstallerArguments -OnLogEvent $onLogEvent
112118
}
113119
catch
114120
{
@@ -122,11 +128,6 @@ function Install-OSPlatformServiceCenter
122128
return $installResult
123129
}
124130

125-
$outputLog = $($result.Output) -Split ("`r`n")
126-
foreach ($logLine in $outputLog)
127-
{
128-
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "SCINSTALLER: $logLine"
129-
}
130131
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "SCInstaller exit code: $($result.ExitCode)"
131132

132133
if ( $result.ExitCode -ne 0 )

src/Outsystems.SetupTools/Functions/New-OSServerConfig.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,14 @@ function New-OSServerConfig
107107
#region generate templates
108108
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "Generating new configuration for database provider $DatabaseProvider"
109109

110+
$onLogEvent = {
111+
param($logLine)
112+
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message $logLine
113+
}
114+
110115
try
111116
{
112-
$result = RunConfigTool -Arguments "/GenerateTemplates"
117+
$result = RunConfigTool -Arguments "/GenerateTemplates" -OnLogEvent $onLogEvent
113118
}
114119
catch
115120
{

src/Outsystems.SetupTools/Functions/Publish-OSPlatformLifetime.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,14 @@ function Publish-OSPlatformLifetime
147147

148148
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "Installing Lifetime. This can take a while..."
149149

150+
$onLogEvent = {
151+
param($logLine)
152+
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message $logLine
153+
}
154+
150155
try
151156
{
152-
$result = PublishSolution -Solution "$osInstallDir\Lifetime.osp" -SCUser $ServiceCenterUser -SCPass $ServiceCenterPass
157+
$result = PublishSolution -Solution "$osInstallDir\Lifetime.osp" -SCUser $ServiceCenterUser -SCPass $ServiceCenterPass -OnLogEvent $onLogEvent
153158
}
154159
catch
155160
{
@@ -163,11 +168,6 @@ function Publish-OSPlatformLifetime
163168
return $installResult
164169
}
165170

166-
$outputLog = $($result.Output) -Split ("`r`n")
167-
foreach ($logLine in $outputLog)
168-
{
169-
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "OSPTOOL: $logLine"
170-
}
171171
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "OSPTool exit code: $($result.ExitCode)"
172172

173173
if ($result.ExitCode -ne 0)

src/Outsystems.SetupTools/Functions/Publish-OSPlatformSolutionPack.ps1

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,15 @@ function Publish-OSPlatformSolutionPack
9696
}
9797

9898
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "Installing Outsystems solution. This can take a while..."
99+
100+
$onLogEvent = {
101+
param($logLine)
102+
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message $logLine
103+
}
104+
99105
try
100106
{
101-
$result = PublishSolution -Solution $solution -SCUser $ServiceCenterUser -SCPass $ServiceCenterPass
107+
$result = PublishSolution -Solution $solution -SCUser $ServiceCenterUser -SCPass $ServiceCenterPass -OnLogEvent $onLogEvent
102108
}
103109
catch
104110
{
@@ -112,11 +118,6 @@ function Publish-OSPlatformSolutionPack
112118
return $publishResult
113119
}
114120

115-
$outputLog = $($result.Output) -Split ("`r`n")
116-
foreach ($logline in $outputLog)
117-
{
118-
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "OSPTOOL: $logline"
119-
}
120121
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "OSPTool exit code: $($result.ExitCode)"
121122

122123
if ( $result.ExitCode -ne 0 )

src/Outsystems.SetupTools/Functions/Publish-OSPlatformSystemComponents.ps1

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,15 @@ function Publish-OSPlatformSystemComponents
134134
}
135135

136136
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "Installing Outsystems System Components. This can take a while..."
137+
138+
$onLogEvent = {
139+
param($logLine)
140+
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message $logLine
141+
}
142+
137143
try
138144
{
139-
$result = PublishSolution -Solution "$osInstallDir\System_Components.osp" -SCUser $ServiceCenterUser -SCPass $ServiceCenterPass
145+
$result = PublishSolution -Solution "$osInstallDir\System_Components.osp" -SCUser $ServiceCenterUser -SCPass $ServiceCenterPass -OnLogEvent $onLogEvent
140146
}
141147
catch
142148
{
@@ -150,11 +156,6 @@ function Publish-OSPlatformSystemComponents
150156
return $installResult
151157
}
152158

153-
$outputLog = $($result.Output) -Split ("`r`n")
154-
foreach ($logline in $outputLog)
155-
{
156-
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "OSPTOOL: $logline"
157-
}
158159
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "OSPTool exit code: $($result.ExitCode)"
159160

160161
if ( $result.ExitCode -ne 0 )

src/Outsystems.SetupTools/Functions/Set-OSPlatformDeploymentZone.ps1

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,15 @@ function Set-OSPlatformDeploymentZone
9090

9191
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "Configuration tool parameters are: $configToolArguments"
9292
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "Running the configuration tool. This can take a while..."
93+
94+
$onLogEvent = {
95+
param($logLine)
96+
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message $logLine
97+
}
98+
9399
try
94100
{
95-
$result = RunConfigTool -Arguments $configToolArguments
101+
$result = RunConfigTool -Arguments $configToolArguments -OnLogEvent $onLogEvent
96102
}
97103
catch
98104
{
@@ -102,11 +108,6 @@ function Set-OSPlatformDeploymentZone
102108
return
103109
}
104110

105-
$confToolOutputLog = $($result.Output) -Split ("`r`n")
106-
foreach ($logline in $confToolOutputLog)
107-
{
108-
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "Configuration Tool: $logline"
109-
}
110111
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "Configuration tool exit code: $($result.ExitCode)"
111112

112113
if ($result.ExitCode -ne 0)

0 commit comments

Comments
 (0)