Visual Studio Online Build将git输出视为错误 [英] Visual Studio Online Build treats git output as errors

查看:124
本文介绍了Visual Studio Online Build将git输出视为错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio Online中的生成尝试通过 Kudu 部署我的Azure网站.该脚本可以正常工作,并且可以进行部署,但是由于某些原因,VSO会将git输出视为错误,并声明整个构建都失败了.看看下面的屏幕截图.

My build in Visual Studio Online tries to deploy my Azure web site via Kudu. The script works fine, and deployment goes through, but VSO treats git output as errors for some reason, and declares the whole build failed. Take a look at the screenshot below.

一些细节:

  1. 这是一个新脚本"版本,而不是XAML定义的版本.
  2. 构建定义只有一个步骤,该步骤执行一个PowerShell脚本,该脚本运行 F#FAKE (不知道这是否相关).
  3. 当我在本地计算机上运行相同的脚本时,看不到任何奇怪"的输出,包括每行末尾的[K.
  4. 在我的本地计算机上运行后,$LastExitCode为零.
  5. 我非常希望将构建过程保持一步,因此我可以继续利用FAKE的功能.
  1. This is a "new scripted" build, not a XAML-defined one.
  2. Build definition has just one step, which executes a PowerShell script, which runs F# FAKE (not sure if this is relevant).
  3. When I run the same script on my local machine, I don't see any "strange" output, including the [K at the end of each line.
  4. After running on my local, $LastExitCode is zero.
  5. I very much would like to keep the build to one step, so I can continue leveraging the power of FAKE.

推荐答案

Git将其内容输出到错误流,Visual Studio Team Services将该错误流解释为错误.

Git outputs its content to the error stream which Visual Studio Team Services interprets as error.

您需要像这样在脚本中重定向Gits输出,以使其正常工作:

You need to redirect Gits output in your script like this to make it working:

git pull 2>&1 | Write-Host

这篇关于Visual Studio Online Build将git输出视为错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆