Codeship在构建管道中使用纱线超时

时间:2016-12-19 17:27:27

标签: node.js yarnpkg codeship

我过去常常使用自定义构建,测试和部署脚本来代码和npm。现在转向纱线,我想继续使用代码。但是,它在10分钟后总是超时yarn命令。

脚本的相关部分是:

nvm install 6.3.1
npm install yarn
yarn

这会产生:

yarn install v0.18.1
[1/4] Resolving packages...
[2/4] Fetching packages...
warning fsevents@1.0.15: The platform "linux" is incompatible with this module.
info "fsevents@1.0.15" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning Incorrect peer dependency "joi@^9.0.4".
[4/4] Building fresh packages...

--------------------------------------------------------------------------------
This command didn't output anything for 10 minutes, thus we stopped it.
Please make sure your steps regularly print to standard out or standard error.
If the error is on our end please inform us so we can help you to fix this.
--------------------------------------------------------------------------------

两者(纱线和代码)是否不相容?

1 个答案:

答案 0 :(得分:1)

@simon解决-将这些拖行添加到Setup Commands部分:

function prevent_codeship_timeout() { ( for i in {1..5}; do echo "Preventing Codeship timeout by echoing every 300 seconds"; sleep 300; done ) & local pid=$!; trap 'kill ${pid}' SIGINT SIGTERM EXIT; }
prevent_codeship_timeout &

通过在Codeship支持中解决此问题,Joe Siewert帮助解决了该问题:

为此,我建议将此脚本添加为构建步骤,然后在后台立即调用它。这只会定期打印一些日志输出,以保持构建运行。它将运行固定的次数,因此您可能需要根据构建步骤的运行时间来增加/减少迭代次数({1..5}部分)

请注意,将整个功能作为一行粘贴到构建步骤中很重要,否则将无法正确读取

感谢您的帮助,乔·西沃特!