Pete
Pete

Reputation: 539

VSO build script output using powershell and custom git deployment

I'm struggeling a bit with VSO / TFS and a powershell script I wrote to run some custom git commands to deploy to a staging environment using git remote.

It's basically working totally fine. the only thing is that VSO is marking the build as partially succeeded because of the build output. It seems like VSO is interpreting everything that gets returned by a process and has more than 5 lines of output is an error. Unfortunatelly git is returning 7 lines:

PS ...\myrepo...> git push test2 master
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 261 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
To ssh://deploy@myhost/var/repo/schimmel.git
74fe89d..efc5906  master -> master

And this is what I see in VSO

VSOBuild

This is how I run git from powershell during a preActionScript

$proc = Start-Process -FilePath $GitExe -ArgumentList $pushArgs -Wait -NoNewWindow -PassThru;
if($proc.ExitCode -ne 0){
    Write-Error "Git is having errors..."
    exit $proc.ExitCode
}

So the build is not failing because the ExitCode is 0 but it seems like its marking the build as partially succeeded because the output is too long.

Upvotes: 0

Views: 931

Answers (1)

Andrew C
Andrew C

Reputation: 14863

Add "--quiet" to your Argument list to git push ?

Upvotes: 2

Related Questions