NuKeeperDotNet / NuKeeper-AzureDevops-extension

NuKeeper AzureDevops and VSTS extension
12 stars 15 forks source link

Nukeeper task fails on Azure DevOps Server #36

Open EP01 opened 5 years ago

EP01 commented 5 years ago

Nukeeper isn't able to work out which platform to use when running on a private build agent for Azure DevOps Server (On-Prem) because the path to the repo is a local one. I tried setting the repo argument in the pipeline, but that doesn't supercede the original value of repo.

Log:

2019-05-31T10:52:50.5602892Z ##[section]Starting: NuKeeper
2019-05-31T10:52:50.5618305Z ==============================================================================
2019-05-31T10:52:50.5619132Z Task         : NuKeeper
2019-05-31T10:52:50.5619524Z Description  : Version 0.4.32
2019-05-31T10:52:50.5619849Z Version      : 0.4.32
2019-05-31T10:52:50.5620233Z Author       : NuKeeper
2019-05-31T10:52:50.5620670Z Help         : For help please visit https://github.com/NuKeeperDotNet/NuKeeper
2019-05-31T10:52:50.5620988Z ==============================================================================
2019-05-31T10:52:52.1747514Z [command]C:\BuildAgent\Stable\Build2016_2.150.3_s1\externals\git\cmd\git.exe config --global user.name NuKeeper
2019-05-31T10:52:52.7729850Z [command]C:\BuildAgent\Stable\Build2016_2.150.3_s1\externals\git\cmd\git.exe config --global user.email nukeeper@nukeeper.com
2019-05-31T10:52:54.2366804Z Downloading: https://api.nuget.org/v3-flatcontainer/nukeeper/0.21.3/nukeeper.0.21.3.nupkg
2019-05-31T10:52:56.5261596Z Extracting archive
2019-05-31T10:52:56.5826009Z [command]C:\Windows\system32\chcp.com 65001
2019-05-31T10:52:56.5829517Z Active code page: 65001
2019-05-31T10:52:56.6101712Z [command]C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('C:\BuildAgent\Stable\Build2016_2.150.3_s1\_work\_temp\6bf33e4d-7b96-48bc-a464-895fdaf76136', 'C:\BuildAgent\Stable\Build2016_2.150.3_s1\_work\_temp\6bf33e4d-7b96-48bc-a464-895fdaf76136.unpacked')"
2019-05-31T10:53:01.4101474Z Caching tool: nukeeper 0.21.3 x64
2019-05-31T10:53:02.8427730Z [command]"C:\Program Files\dotnet\dotnet.exe" C:\BuildAgent\Stable\Build2016_2.150.3_s1\_work\_tool\nukeeper\0.21.3\x64\NuKeeper.dll repo C:\BuildAgent\Stable\Build2016_2.150.3_s1\_work\24\s *** --targetBranch origin/master --maxpackageupdates 100 --consolidate --age 0 --verbosity detailed
2019-05-31T10:53:09.6843849Z No valid Gitea repo during repo check
2019-05-31T10:53:09.6845221Z 
2019-05-31T10:53:09.6845675Z Only 'http' and 'https' schemes are allowed.
2019-05-31T10:53:09.6846034Z Parameter name: value
2019-05-31T10:53:09.6869803Z Unable to work out which platform to use C:\BuildAgent\Stable\Build2016_2.150.3_s1\_work\24\s could not be matched
2019-05-31T10:53:09.7312125Z ##[error]Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 4294967295
2019-05-31T10:53:09.7418971Z ##[section]Finishing: NuKeeper
MaxMommersteeg commented 5 years ago

I think NuKeeper is having a hard time trying to determine what platform you are using. Gitea seems to have the most tolerant ISettingsReader.CanRead() method. Because of this NuKeeper thinks it's running on a Gitea server.

Could you try to add --platform "AzureDevOps" as an argument to the NuKeeper task?

MarcBruins commented 5 years ago

Gitea is the last in the Settingsreaders loop and thats why you see a gitea message.

MarcBruins commented 5 years ago

And I think this is an issue with NuKeeper itself and not the extension. What happens if you run nukeeper repo /path/to/repo {pat} - - targetbranch origin/master? Should return the same output.

Adding the platform parameter should work in your case as Max said

EP01 commented 5 years ago

Hi guys, thanks for the quick responses. I didn't have time to look at the problem again until Friday. I tried both suggestions, separately and together, and got the same result (as below).

2019-06-07T10:57:58.3167348Z ##[section]Starting: NuKeeper
2019-06-07T10:57:58.3180948Z ==============================================================================
2019-06-07T10:57:58.3181733Z Task         : NuKeeper
2019-06-07T10:57:58.3182086Z Description  : Version 0.4.34
2019-06-07T10:57:58.3182420Z Version      : 0.4.34
2019-06-07T10:57:58.3182802Z Author       : NuKeeper
2019-06-07T10:57:58.3183087Z Help         : For help please visit https://github.com/NuKeeperDotNet/NuKeeper
2019-06-07T10:57:58.3183485Z ==============================================================================
2019-06-07T10:57:59.5055997Z [command]C:\BuildAgent\Stable\Build_2.150.3_s1\externals\git\cmd\git.exe config --global user.name NuKeeper
2019-06-07T10:57:59.6446736Z [command]C:\BuildAgent\Stable\Build_2.150.3_s1\externals\git\cmd\git.exe config --global user.email nukeeper@nukeeper.com
2019-06-07T10:58:00.4708882Z Found tool in cache: nukeeper 0.21.3 x64
2019-06-07T10:58:00.5051111Z [command]"C:\Program Files\dotnet\dotnet.exe" C:\BuildAgent\Stable\Build_2.150.3_s1\_work\_tool\nukeeper\0.21.3\x64\NuKeeper.dll repo C:\BuildAgent\Stable\Build_2.150.3_s1\_work\20\s *** --targetBranch origin/master --maxpackageupdates 100 --consolidate --age 0 --verbosity detailed --platform AzureDevOps
2019-06-07T10:58:01.6910449Z No valid Gitea repo during repo check
2019-06-07T10:58:01.6911563Z 
2019-06-07T10:58:01.6911899Z Only 'http' and 'https' schemes are allowed.
2019-06-07T10:58:01.6912238Z Parameter name: value
2019-06-07T10:58:01.6937272Z Unable to work out which platform to use C:\BuildAgent\Stable\Build_2.150.3_s1\_work\20\s could not be matched
2019-06-07T10:58:01.7249423Z ##[error]Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 4294967295
2019-06-07T10:58:01.7336132Z ##[section]Finishing: NuKeeper

I also noticed that it strips out the quotation marks from the --targetplatform argument when actually running the command. Could this affect the result? nukeeper_definition