From 598f27852df98b2532a6083d9f4282c956687e47 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 31 Aug 2018 16:33:42 -0700 Subject: [PATCH 01/15] [Feature] Add daily support --- tools/travis.ps1 | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/tools/travis.ps1 b/tools/travis.ps1 index 04b65bc0933..a50117664ab 100644 --- a/tools/travis.ps1 +++ b/tools/travis.ps1 @@ -155,11 +155,25 @@ function Set-DailyBuildBadge $isPR = $env:TRAVIS_EVENT_TYPE -eq 'pull_request' # For PRs, Travis-ci strips out [ and ] so read the message directly from git -if($env:TRAVIS_EVENT_TYPE -eq 'pull_request') +if($env:TRAVIS_EVENT_TYPE -eq 'pull_request' -or $env:BUILD_REASON) { + $commitId = $null + if ($env:TRAVIS_EVENT_TYPE) + { + # We are in Travis-CI + $commitId = $env:TRAVIS_PULL_REQUEST_SHA + } + elseif($env:BUILD_REASON) + { + # We are in VSTS + $commitId = $env:BUILD_SOURCEVERSION + Write-Verbose "VSTS commitId: $commitId" -Verbose + } + # If the current job is a pull request, the env variable 'TRAVIS_PULL_REQUEST_SHA' contains # the commit SHA of the HEAD commit of the PR. - $commitMessage = git log --format=%B -n 1 $env:TRAVIS_PULL_REQUEST_SHA + $commitMessage = git log --format=%B -n 1 $commitId + Write-Verbose "commitMessage: $commitMessage" -verbose } else { @@ -171,13 +185,18 @@ $hasFeatureTag = $commitMessage -match '\[feature\]' $hasPackageTag = $commitMessage -match '\[package\]' $createPackages = -not $isPr -or $hasPackageTag $hasRunFailingTestTag = $commitMessage -match '\[includeFailingTest\]' -$isDailyBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' -or $env:TRAVIS_EVENT_TYPE -eq 'api' +$isDailyBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' -or $env:TRAVIS_EVENT_TYPE -eq 'api' -or $env:BUILD_REASON -eq 'Schedule' # only update the build badge for the cron job -$cronBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' +$cronBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' -or $env:BUILD_REASON -eq 'Schedule' $isFullBuild = $isDailyBuild -or $hasFeatureTag if($Stage -eq 'Bootstrap') { + if($cronBuild -and $env:TF_BUILD) + { + Write-Host "##vso[build.updatebuildnumber]Daily-$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhss"))" + } + Write-Host -Foreground Green "Executing travis.ps1 -BootStrap `$isPR='$isPr' - $commitMessage" # Make sure we have all the tags Sync-PSTags -AddRemoteIfMissing From 7275b5fd3e691b6e78a0a9c9038773ea8545486c Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 29 Aug 2018 15:51:02 -0700 Subject: [PATCH 02/15] use environment variables for mac and Linux to force feature and package --- tools/travis.ps1 | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/tools/travis.ps1 b/tools/travis.ps1 index a50117664ab..4890dbafcb3 100644 --- a/tools/travis.ps1 +++ b/tools/travis.ps1 @@ -154,6 +154,8 @@ function Set-DailyBuildBadge # One of push, pull_request, api, cron. $isPR = $env:TRAVIS_EVENT_TYPE -eq 'pull_request' +$commitMessage = [string]::Empty + # For PRs, Travis-ci strips out [ and ] so read the message directly from git if($env:TRAVIS_EVENT_TYPE -eq 'pull_request' -or $env:BUILD_REASON) { @@ -162,18 +164,12 @@ if($env:TRAVIS_EVENT_TYPE -eq 'pull_request' -or $env:BUILD_REASON) { # We are in Travis-CI $commitId = $env:TRAVIS_PULL_REQUEST_SHA - } - elseif($env:BUILD_REASON) - { - # We are in VSTS - $commitId = $env:BUILD_SOURCEVERSION - Write-Verbose "VSTS commitId: $commitId" -Verbose - } - # If the current job is a pull request, the env variable 'TRAVIS_PULL_REQUEST_SHA' contains - # the commit SHA of the HEAD commit of the PR. - $commitMessage = git log --format=%B -n 1 $commitId - Write-Verbose "commitMessage: $commitMessage" -verbose + # If the current job is a pull request, the env variable 'TRAVIS_PULL_REQUEST_SHA' contains + # the commit SHA of the HEAD commit of the PR. + $commitMessage = git log --format=%B -n 1 $commitId + Write-Verbose "commitMessage: $commitMessage" -verbose + } } else { @@ -181,8 +177,8 @@ else } # Run a full build if the build was trigger via cron, api or the commit message contains `[Feature]` -$hasFeatureTag = $commitMessage -match '\[feature\]' -$hasPackageTag = $commitMessage -match '\[package\]' +$hasFeatureTag = $commitMessage -match '\[feature\]' -or $env:FORCE_FEATURE -eq 'True' +$hasPackageTag = $commitMessage -match '\[package\]' -or $env:FORCE_PACKAGE -eq 'True' $createPackages = -not $isPr -or $hasPackageTag $hasRunFailingTestTag = $commitMessage -match '\[includeFailingTest\]' $isDailyBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' -or $env:TRAVIS_EVENT_TYPE -eq 'api' -or $env:BUILD_REASON -eq 'Schedule' From ee91c8cdf1c59a27e26248f3186b2493203327a7 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 4 Sep 2018 10:44:00 -0700 Subject: [PATCH 03/15] Add comments per feedback --- tools/travis.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/travis.ps1 b/tools/travis.ps1 index 4890dbafcb3..a0f709116ba 100644 --- a/tools/travis.ps1 +++ b/tools/travis.ps1 @@ -177,7 +177,11 @@ else } # Run a full build if the build was trigger via cron, api or the commit message contains `[Feature]` +# or the environment valiable `FORCE_FEATURE` equals `True` $hasFeatureTag = $commitMessage -match '\[feature\]' -or $env:FORCE_FEATURE -eq 'True' + +# Run a packaging if the commit message contains `[Package]` +# or the environment valiable `FORCE_PACKAGE` equals `True` $hasPackageTag = $commitMessage -match '\[package\]' -or $env:FORCE_PACKAGE -eq 'True' $createPackages = -not $isPr -or $hasPackageTag $hasRunFailingTestTag = $commitMessage -match '\[includeFailingTest\]' @@ -190,7 +194,7 @@ if($Stage -eq 'Bootstrap') { if($cronBuild -and $env:TF_BUILD) { - Write-Host "##vso[build.updatebuildnumber]Daily-$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhss"))" + Write-Host "##vso[build.updatebuildnumber]Daily-$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" } Write-Host -Foreground Green "Executing travis.ps1 -BootStrap `$isPR='$isPr' - $commitMessage" From bc000cf1904e8bca664dc0686a166ea5555e4560 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 4 Sep 2018 10:44:22 -0700 Subject: [PATCH 04/15] capture environment --- .vsts-ci/linux.yml | 7 ++++++- .vsts-ci/mac.yml | 7 ++++++- .vsts-ci/windows.yml | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.vsts-ci/linux.yml b/.vsts-ci/linux.yml index eb38e2ca73b..9c25be3f566 100644 --- a/.vsts-ci/linux.yml +++ b/.vsts-ci/linux.yml @@ -16,7 +16,12 @@ phases: queue: name: Hosted Linux Preview steps: - - powershell: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhss"))" + - powershell: | + Get-ChildItem -Path env: + displayName: Capture envirenment + condition: succeededOrFailed() + + - powershell: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" displayName: Set Build Name for Non-PR condition: ne(variables['Build.Reason'], 'PullRequest') diff --git a/.vsts-ci/mac.yml b/.vsts-ci/mac.yml index 39a923233ff..c12fe40255d 100644 --- a/.vsts-ci/mac.yml +++ b/.vsts-ci/mac.yml @@ -16,7 +16,12 @@ phases: queue: name: Hosted macOS Preview steps: - - powershell: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhss"))" + - powershell: | + Get-ChildItem -Path env: + displayName: Capture envirenment + condition: succeededOrFailed() + + - powershell: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" displayName: Set Build Name for Non-PR condition: ne(variables['Build.Reason'], 'PullRequest') diff --git a/.vsts-ci/windows.yml b/.vsts-ci/windows.yml index f3541593a3d..d10705777d3 100644 --- a/.vsts-ci/windows.yml +++ b/.vsts-ci/windows.yml @@ -20,7 +20,12 @@ resources: clean: true steps: - - powershell: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhss"))" + - powershell: | + Get-ChildItem -Path env: + displayName: Capture envirenment + condition: succeededOrFailed() + + - powershell: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" displayName: Set Build Name for Non-PR condition: ne(variables['Build.Reason'], 'PullRequest') From 13cc43fe26a5bf231c556d5597466258e59bd8db Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 4 Sep 2018 12:41:08 -0700 Subject: [PATCH 05/15] [Feature] make VSTS work with `[Feature]` --- tools/travis.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/travis.ps1 b/tools/travis.ps1 index a0f709116ba..282ddee8229 100644 --- a/tools/travis.ps1 +++ b/tools/travis.ps1 @@ -170,6 +170,19 @@ if($env:TRAVIS_EVENT_TYPE -eq 'pull_request' -or $env:BUILD_REASON) $commitMessage = git log --format=%B -n 1 $commitId Write-Verbose "commitMessage: $commitMessage" -verbose } + elseif($env:TF_BUILD) + { + if($env:BUILD_SOURCEVERSIONMESSAGE -match 'Merge\s*([0-9A-F]*)') + { + # We are in VSTS and have a commit ID in the Source Version Message + $commitId = $Matches[1] + $commitMessage = git log --format=%B -n 1 $commitId + } + else + { + Write-Log "Unknown BUILD_SOURCEVERSIONMESSAGE format '$env:BUILD_SOURCEVERSIONMESSAGE'" -Verbose + } + } } else { From 161a8e7e3bca7ddc26187313d1a849cb448fed89 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 4 Sep 2018 13:27:09 -0700 Subject: [PATCH 06/15] remove as script uploads artifacts now --- .vsts-ci/linux.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.vsts-ci/linux.yml b/.vsts-ci/linux.yml index 9c25be3f566..a6ab8a9f964 100644 --- a/.vsts-ci/linux.yml +++ b/.vsts-ci/linux.yml @@ -70,14 +70,5 @@ phases: Write-Host "##vso[artifact.upload containerfolder=artifacts;artifactname=artifacts]$_" } displayName: Publish Artifacts - condition: succeededOrFailed() - continueOnError: true - - # Uploads any Test results as an artifact - - powershell: | - Get-ChildItem -Path Test*.xml, *XUnitTestResults.xml -Recurse | Select-Object -ExpandProperty FullName | ForEach-Object { - Write-Host "##vso[artifact.upload containerfolder=testResults;artifactname=testResults]$_" - } - displayName: Publish Test Results condition: ne(variables['Build.Reason'], 'PullRequest') continueOnError: true From 2169db944c9552648fa283ba269774757510558f Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 4 Sep 2018 14:18:24 -0700 Subject: [PATCH 07/15] update linux pool --- .vsts-ci/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vsts-ci/linux.yml b/.vsts-ci/linux.yml index a6ab8a9f964..54a93221fd8 100644 --- a/.vsts-ci/linux.yml +++ b/.vsts-ci/linux.yml @@ -14,7 +14,7 @@ phases: - phase: Linux_CI queue: - name: Hosted Linux Preview + name: Hosted Ubuntu 1604 steps: - powershell: | Get-ChildItem -Path env: From dfda2c91738ad0651e72f8691d42841d0c11aa86 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 4 Sep 2018 14:16:14 -0700 Subject: [PATCH 08/15] [Feature] switch to production mac pool --- .vsts-ci/mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vsts-ci/mac.yml b/.vsts-ci/mac.yml index c12fe40255d..f2db56f1194 100644 --- a/.vsts-ci/mac.yml +++ b/.vsts-ci/mac.yml @@ -14,7 +14,7 @@ phases: - phase: macOS_CI queue: - name: Hosted macOS Preview + name: Hosted macOS steps: - powershell: | Get-ChildItem -Path env: From 0dcf406f8809d26249d6d20251bb3ae989658e9c Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 4 Sep 2018 14:21:08 -0700 Subject: [PATCH 09/15] [feature] use sudo for apt-get commands --- .vsts-ci/linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vsts-ci/linux.yml b/.vsts-ci/linux.yml index 54a93221fd8..345a4464304 100644 --- a/.vsts-ci/linux.yml +++ b/.vsts-ci/linux.yml @@ -38,8 +38,8 @@ phases: condition: succeededOrFailed() - powershell: | - apt-get update - apt-get install -y --no-install-recommends less + sudo apt-get update + sudo apt-get install -y --no-install-recommends less displayName: Install less condition: succeededOrFailed() From 6df16129294e651c3cccd1b1de2bffc12b70f95c Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 4 Sep 2018 15:29:15 -0700 Subject: [PATCH 10/15] [Feature] Workaround using no profile --- test/powershell/Host/ConsoleHost.Tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/powershell/Host/ConsoleHost.Tests.ps1 b/test/powershell/Host/ConsoleHost.Tests.ps1 index b6f3e35a696..0e3effd9f0f 100644 --- a/test/powershell/Host/ConsoleHost.Tests.ps1 +++ b/test/powershell/Host/ConsoleHost.Tests.ps1 @@ -548,7 +548,7 @@ foo @{ value = "~\$folderName"; expectedPath = $((Get-Item ~\$folderName).FullName) } ) { param($value, $expectedPath) - $output = & $powershell -WorkingDirectory "$value" -Command "`$pwd.Path" + $output = & $powershell -NoProfile -WorkingDirectory "$value" -Command "`$pwd.Path" $output | Should -BeExactly $expectedPath } @@ -558,7 +558,7 @@ foo @{ parameter = '-wo' } ) { param($parameter) - $output = & $powershell $parameter ~ -Command "`$pwd.Path" + $output = & $powershell -NoProfile $parameter ~ -Command "`$pwd.Path" $output | Should -BeExactly $((Get-Item ~).FullName) } From 8f3761701c6e80ac842f2c697cdb203e1d5e7886 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 4 Sep 2018 15:55:12 -0700 Subject: [PATCH 11/15] run gem with sudo in VSTS --- build.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index 33e75e5063f..41e3d94676d 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1825,7 +1825,7 @@ function Start-PSBootstrap { # We cannot guess if the user wants to run gem install as root on linux and windows, # but macOs usually requires sudo $gemsudo = '' - if($Environment.IsMacOS) { + if($Environment.IsMacOS -or $env:TF_BUILD) { $gemsudo = $sudo } Start-NativeExecution ([ScriptBlock]::Create("$gemsudo gem install fpm -v 1.10.0")) From a3acb45d98f100301b0d2b6fe8c843b803465ac8 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 5 Sep 2018 13:30:22 -0700 Subject: [PATCH 12/15] update test --- test/powershell/Host/ConsoleHost.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/powershell/Host/ConsoleHost.Tests.ps1 b/test/powershell/Host/ConsoleHost.Tests.ps1 index 0e3effd9f0f..7120283af15 100644 --- a/test/powershell/Host/ConsoleHost.Tests.ps1 +++ b/test/powershell/Host/ConsoleHost.Tests.ps1 @@ -548,7 +548,7 @@ foo @{ value = "~\$folderName"; expectedPath = $((Get-Item ~\$folderName).FullName) } ) { param($value, $expectedPath) - $output = & $powershell -NoProfile -WorkingDirectory "$value" -Command "`$pwd.Path" + $output = & $powershell -NoProfile -WorkingDirectory "$value" -Command '(Get-Location).Path' $output | Should -BeExactly $expectedPath } From aa6b2421eb170131b10d299ebe6304516234f4d9 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 5 Sep 2018 15:43:50 -0700 Subject: [PATCH 13/15] [Feature] Update ExecuteCommandAsyncHelper to actually execute command when not reading input --- .../host/msh/Executor.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs index c4a5e53747f..0ee81240bad 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs @@ -160,6 +160,18 @@ internal void ExecuteCommandAsync(string command, out Exception exceptionThrown, ExecuteCommandAsyncHelper(tempPipeline, out exceptionThrown, options); } + /// + /// Executes a pipeline in the console when we are running asnyc + /// + /// + /// The pipeline to execute + /// + /// + /// any exception thrown trying to run the pipeline + /// + /// + /// The options to use to execute the pipeline + /// internal void ExecuteCommandAsyncHelper(Pipeline tempPipeline, out Exception exceptionThrown, ExecutionOptions options) { Dbg.Assert(!_isPromptFunctionExecutor, "should not async invoke the prompt"); @@ -194,6 +206,13 @@ internal void ExecuteCommandAsyncHelper(Pipeline tempPipeline, out Exception exc tempPipeline.Error.DataReady += new EventHandler(ErrorObjectStreamHandler); PipelineFinishedWaitHandle waiterThereIsAFlyInMySoup = new PipelineFinishedWaitHandle(tempPipeline); + // close the input pipeline so the command will do something + // if we are not reading input + if((options & Executor.ExecutionOptions.ReadInputObjects) == 0) + { + tempPipeline.Input.Close(); + } + tempPipeline.InvokeAsync(); if ((options & ExecutionOptions.ReadInputObjects) > 0 && Console.IsInputRedirected) { From d7109b45cd949d3469a1cf7efa080c8591855382 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 5 Sep 2018 19:13:05 -0700 Subject: [PATCH 14/15] fix codefactor issues --- .../host/msh/Executor.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs index 0ee81240bad..5edd9d1a8a6 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs @@ -161,16 +161,16 @@ internal void ExecuteCommandAsync(string command, out Exception exceptionThrown, } /// - /// Executes a pipeline in the console when we are running asnyc + /// Executes a pipeline in the console when we are running asnyc. /// /// - /// The pipeline to execute + /// The pipeline to execute. /// /// - /// any exception thrown trying to run the pipeline + /// Any exception thrown trying to run the pipeline. /// /// - /// The options to use to execute the pipeline + /// The options to use to execute the pipeline. /// internal void ExecuteCommandAsyncHelper(Pipeline tempPipeline, out Exception exceptionThrown, ExecutionOptions options) { @@ -208,7 +208,7 @@ internal void ExecuteCommandAsyncHelper(Pipeline tempPipeline, out Exception exc // close the input pipeline so the command will do something // if we are not reading input - if((options & Executor.ExecutionOptions.ReadInputObjects) == 0) + if ((options & Executor.ExecutionOptions.ReadInputObjects) == 0) { tempPipeline.Input.Close(); } From e9c57a3a6f8e99d0360928ef18fa28e2ae2ac1a3 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 6 Sep 2018 10:10:35 -0700 Subject: [PATCH 15/15] Address PR comments --- .vsts-ci/linux.yml | 2 +- .vsts-ci/mac.yml | 2 +- .vsts-ci/windows.yml | 2 +- src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs | 4 ++-- tools/travis.ps1 | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.vsts-ci/linux.yml b/.vsts-ci/linux.yml index 345a4464304..4d1131c9968 100644 --- a/.vsts-ci/linux.yml +++ b/.vsts-ci/linux.yml @@ -18,7 +18,7 @@ phases: steps: - powershell: | Get-ChildItem -Path env: - displayName: Capture envirenment + displayName: Capture environment condition: succeededOrFailed() - powershell: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" diff --git a/.vsts-ci/mac.yml b/.vsts-ci/mac.yml index f2db56f1194..55212e9d868 100644 --- a/.vsts-ci/mac.yml +++ b/.vsts-ci/mac.yml @@ -18,7 +18,7 @@ phases: steps: - powershell: | Get-ChildItem -Path env: - displayName: Capture envirenment + displayName: Capture environment condition: succeededOrFailed() - powershell: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" diff --git a/.vsts-ci/windows.yml b/.vsts-ci/windows.yml index d10705777d3..80da3a87437 100644 --- a/.vsts-ci/windows.yml +++ b/.vsts-ci/windows.yml @@ -22,7 +22,7 @@ resources: steps: - powershell: | Get-ChildItem -Path env: - displayName: Capture envirenment + displayName: Capture environment condition: succeededOrFailed() - powershell: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs index 5edd9d1a8a6..e067593f830 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs @@ -204,7 +204,7 @@ internal void ExecuteCommandAsyncHelper(Pipeline tempPipeline, out Exception exc tempPipeline.Output.DataReady += new EventHandler(OutputObjectStreamHandler); tempPipeline.Error.DataReady += new EventHandler(ErrorObjectStreamHandler); - PipelineFinishedWaitHandle waiterThereIsAFlyInMySoup = new PipelineFinishedWaitHandle(tempPipeline); + PipelineFinishedWaitHandle pipelineWaiter = new PipelineFinishedWaitHandle(tempPipeline); // close the input pipeline so the command will do something // if we are not reading input @@ -243,7 +243,7 @@ internal void ExecuteCommandAsyncHelper(Pipeline tempPipeline, out Exception exc } tempPipeline.Input.Close(); - waiterThereIsAFlyInMySoup.Wait(); + pipelineWaiter.Wait(); //report error if pipeline failed if (tempPipeline.PipelineStateInfo.State == PipelineState.Failed && tempPipeline.PipelineStateInfo.Reason != null) diff --git a/tools/travis.ps1 b/tools/travis.ps1 index 282ddee8229..217377ca55e 100644 --- a/tools/travis.ps1 +++ b/tools/travis.ps1 @@ -168,7 +168,7 @@ if($env:TRAVIS_EVENT_TYPE -eq 'pull_request' -or $env:BUILD_REASON) # If the current job is a pull request, the env variable 'TRAVIS_PULL_REQUEST_SHA' contains # the commit SHA of the HEAD commit of the PR. $commitMessage = git log --format=%B -n 1 $commitId - Write-Verbose "commitMessage: $commitMessage" -verbose + Write-Log -message "commitMessage: $commitMessage" } elseif($env:TF_BUILD) { @@ -190,11 +190,11 @@ else } # Run a full build if the build was trigger via cron, api or the commit message contains `[Feature]` -# or the environment valiable `FORCE_FEATURE` equals `True` +# or the environment variable `FORCE_FEATURE` equals `True` $hasFeatureTag = $commitMessage -match '\[feature\]' -or $env:FORCE_FEATURE -eq 'True' # Run a packaging if the commit message contains `[Package]` -# or the environment valiable `FORCE_PACKAGE` equals `True` +# or the environment variable `FORCE_PACKAGE` equals `True` $hasPackageTag = $commitMessage -match '\[package\]' -or $env:FORCE_PACKAGE -eq 'True' $createPackages = -not $isPr -or $hasPackageTag $hasRunFailingTestTag = $commitMessage -match '\[includeFailingTest\]'