Linux Shell脚本构建步骤超时 [英] Linux Shell Script build step timeout

查看:76
本文介绍了Linux Shell脚本构建步骤超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为在Linux上运行的构建定义(Ubuntu 14)的一部分,我有一个shell脚本任务。 该脚本只使用一个参数运行'make'。 制作需要很长时间才能运行(超过一小时)。 我将任务 超时设置为
0,这应该意味着没有超时,但它会在60分钟后超时。 我将超时设置为180,并且60分钟后
超时。 

As part of a build definition running on Linux (Ubuntu 14) I have a shell script task.  The script simply runs 'make' with one argument.  The make takes quite a long time to run (well over an hour).  I have the task timeout set to 0, which is supposed to mean no timeout, but it is timing out after 60 minutes.  I set the timeout to 180, and it still times out after 60 minutes. 

TFS 2017内部部署,构建机器正在运行Ubuntu 14.04。

TFS 2017 on-premise, build machine is running Ubuntu 14.04.

这是一个showstopper对我们而言,我面临着很大的压力,需要让自动构建工作。 我发现Linux构建代理的信息非常少。

This is a showstopper for us and I am under a lot of pressure to get automated builds working.  I've found very little information on the Linux build agent.

任何帮助都将不胜感激。

Any help would be greatly appreciated.

脚本文件非常简单:

#!/bin/bash
# This script is invoked by TFS Build
set -o errexit
pushd `dirname $0`
whoami
env
make key_release
popd

TFS日志的开头和结尾:

The beginning and end of the TFS log:

2017-01-06T22:07:32.0887440Z ##[section]Starting: Build
2017-01-06T22:07:32.1413120Z Current agent version: '2.105.7'
...
2017-01-06T23:07:31.2879350Z ##[error]The operation was canceled.
2017-01-06T23:07:31.3095920Z ##[section]Finishing: Shell Script Tools/Build.linux/TFSBuild-buildroot.sh
2017-01-06T23:07:31.3131280Z ##[error]The operation was canceled.
2017-01-06T23:07:31.3166990Z ##[section]Finishing: Build

推荐答案

我的错。 除了默认为0(无限)的单个构建步骤的超时之外,我忽略了整个构建的超时,默认为60. 这就是取消任务的原因。 也许这会帮助
遇到同样事情的其他人。 如果日志指示构建定义本身超时,而不是单个任务,则可能会有所帮助。
My fault.  In addition to the timeout on individual build steps which defaults to 0 (infinite) there is a timeout on the entire build that I had overlooked, which defaults to 60.  This is what was cancelling the task.  Maybe this will help someone else who runs into the same thing.  It probably would be helpful if the log indicated that the build definition itself timed out, rather than the individual task.


这篇关于Linux Shell脚本构建步骤超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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