devblackops / Stucco

An opinionated Plaster template for high-quality PowerShell modules
MIT License
194 stars 28 forks source link

Invoke-Git error when running on Azure Pipelines hosted agent #10

Closed cuzza0 closed 4 years ago

cuzza0 commented 4 years ago

Description When the boilerplate/example output is generated with Azure Pipelines CICD, and then built using the configured Azure Pipelines hosted agent, the build task fails with the following error - Invoke-Git : fatal: ambiguous argument 'Powershell': unknown revision or path not in the working tree.

Steps to Reproduce

  1. Run Plaster with Stucco template, specify Azure Pipelines as the CI of choice
  2. Commit resulting scaffold to Azure Repos git repo
  3. Create a new Azure Pipelines pipeline using the yaml configuration provided
  4. Run the pipeline, pipeline will fail

Current Behavior

2019-10-02T06:37:41.3923308Z ##[section]Starting: Build and Test
2019-10-02T06:37:41.4034056Z ==============================================================================
2019-10-02T06:37:41.4034109Z Task         : PowerShell
2019-10-02T06:37:41.4035286Z Description  : Run a PowerShell script on Linux, macOS, or Windows
2019-10-02T06:37:41.4035324Z Version      : 2.151.2
2019-10-02T06:37:41.4035359Z Author       : Microsoft Corporation
2019-10-02T06:37:41.4035418Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
2019-10-02T06:37:41.4035454Z ==============================================================================
2019-10-02T06:37:42.7477834Z Generating script.
2019-10-02T06:37:42.8919200Z ========================== Starting Command Output ===========================
2019-10-02T06:37:42.9211389Z ##[command]"C:\Program Files\PowerShell\6\pwsh.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'd:\a\_temp\13196e40-d3e5-431e-8575-2605ead37909.ps1'"
2019-10-02T06:37:53.9059999Z VERBOSE: Acquiring providers for assembly: C:\program files\powershell\6\Modules\PackageManagement\coreclr\netstandard2.0\Microsoft.PackageManagement.CoreProviders.dll
2019-10-02T06:37:53.9766460Z VERBOSE: Acquiring providers for assembly: C:\program files\powershell\6\Modules\PackageManagement\coreclr\netstandard2.0\Microsoft.PackageManagement.MetaProvider.PowerShell.dll
2019-10-02T06:37:53.9772010Z VERBOSE: Acquiring providers for assembly: C:\program files\powershell\6\Modules\PackageManagement\coreclr\netstandard2.0\Microsoft.PackageManagement.ArchiverProviders.dll
2019-10-02T06:37:53.9776303Z VERBOSE: Acquiring providers for assembly: C:\program files\powershell\6\Modules\PackageManagement\coreclr\netstandard2.0\Microsoft.PackageManagement.NuGetProvider.dll
2019-10-02T06:38:49.2034932Z Invoke-Git : fatal: ambiguous argument 'Powershell': unknown revision or path not in the working tree.
2019-10-02T06:38:49.2037004Z At C:\Users\VssAdministrator\Documents\PowerShell\Modules\BuildHelpers\2.0.8\Public\Get-BuildVariable.ps1:184 char:17
2019-10-02T06:38:49.2037075Z + ...             Invoke-Git @IGParams -Arguments "log --format=%B -n 1 $(  ...
2019-10-02T06:38:49.2038540Z +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-10-02T06:38:49.2038794Z + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
2019-10-02T06:38:49.2040288Z + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-Git
2019-10-02T06:38:49.2040535Z  
2019-10-02T06:38:49.3464963Z ##[error]PowerShell exited with code '1'.
2019-10-02T06:38:49.3939499Z ##[section]Finishing: Build and Test

Expected behavior No error returned and successful pipeline

Possible Solution Fixed locally by updating BuildHelpers from 2.0.8 to 2.0.11

Environment

Additional context

cuzza0 commented 4 years ago

Apparently this has been fixed in a commit by @ghvanderweg already so Closing this off. Still existed a few weeks ago when we started using Stucco but have been busy. Sorry!