gpt4 book ai didi

azure - 我在 Azure 管道步骤中收到 "Bash wrote one or more lines to the standard error stream"

转载 作者:行者123 更新时间:2023-12-02 06:44:43 34 4
gpt4 key购买 nike

我正在运行以下-bash命令:

    bash: $(ci_scripts_path)/01_install_python_tools.shdisplayName: '安装 python 2.7 工具'failOnStderr:true

虽然 sh 脚本 01_install_python_tools.sh 成功完成,但无论如何我在该步骤中收到此错误:##[error]Bash 将一行或多行写入标准错误流。

最佳答案

我今天刚刚处理这个问题,并通过取消选中 Bash 任务的高级选项中的“标准错误失败”来解决它。如果您的脚本返回非零退出代码,该步骤仍然会失败,但如果您返回 0,该步骤将会成功。

所以,如果我想返回成功,我有脚本exit 0如果我想抛出错误,我会执行exit 1。例如,我有一个执行以下操作的脚本:

if [ "$someResult" == "yay it worked" ] then
echo "Success!"
exit 0
else
echo "Failsauce!"
exit 1
fi

我想了很长一段时间,我必须启用该选项才能将失败返回到管道中,但显然情况并非如此。

关于azure - 我在 Azure 管道步骤中收到 "Bash wrote one or more lines to the standard error stream",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54697104/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com