Frage

I am trying to alter our build process so that particular folders are packed into nuget packages (this is after they have been built), so that they can then be deployed by Octopus deploy. The powershell scripts to do this work fine on my computer.

However, when I run them on the build computer they will work for one folder, and then start failing. If I change the filter so it operates against one of the folders that failed in the previous build it will work for that folder, but not any of the subsequent ones.

The powershell script looks like this:

#pack into nuget
$command = "$scriptpath\nuget.exe pack ""$nuspecfile"" -NoPackageAnalysis -OutputDirectory ""$deployFolder\..\nuget"""
write-host "command is: $command"
iex $command

It works for all the subfolders in the first folder to produce 8 nuget packages, and I get the following output:

command is:[...] Attempting to build package from 'ECF_Database_Upgrade_QA.nuspec'. Successfully created package '\zaklpegffs004\Group\IT\IT Projects\Active Project Status\TFS\Drop\WWOL.Dev\WWOL.Dev_0.0.0.{CS}_Dev.94\QA\ECF Database Upgrade.. uget\ECF_Database_Upgrade_QA.0.0.0.9156.nupkg'.

When it fails I just get the following in the logs:

command is: [...]

with no other output

Latest update I have added code to write the return code from the batch file, like so:

write-host $LastExitCode

This returns 0 for the times when it works and -1073741502 when it fails.

War es hilfreich?

Lösung

The answer in case anyone else ever runs into this problem, is that after Write-Host has been called a number of times there seems to be a bug which stops external exes from being launched (in my case nuget.exe)

I commented out all the write-host commands and the call to nuget started working perfectly.

Similar problem and solution here:

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top